-
Notifications
You must be signed in to change notification settings - Fork 139
Closed
testdouble/quibble
#109Description
Description
When the specifier provided to replaceEsm() needs to be resolved by a loader, the resolution is done correctly, but testdouble is not using the resolved value, which causes the replacement to actually fail:
node --loader=testdouble --loader=alias-resolver ./main.mjs// main.mjs
await ts.replaceEsm('…/foo.mjs', { isFake: true });
console.log('foo:', await import('…/foo.mjs')) // the original foo.mjsWhere alias-resolver replaces …/ and provides the true url.
Environment
node -voutput:21.7.0(and also20.11.1)npm -v(oryarn --version) output:10.5.0npm ls testdouble(oryarn list testdouble) version:3.20.1
Failing Test
- Fork the repo
- Add a failing test (probably to the `/regression/src' directory)
- Submit a pull request for the failing test or link to your branch here
Example Repo
Reproduction: JakobJingleheimer/td-global-mock@0008fb5
"Fixed": JakobJingleheimer/td-global-mock@e5775aa
This is truly mind-bending because all the urls testdouble output are correct (ex from td.listReplacedModules()), so everything appears to be working—except that it clearly isn't.
Runkit Notebook
- Create a Runkit notebook
- Invoke
var td = require('testdouble')at the top - Verify the behavior your issue is concerned with by clicking "Run"
- Link to the Runkit here
Metadata
Metadata
Assignees
Labels
No labels