You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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
Where
alias-resolver
replaces…/
and provides the true url.Environment
node -v
output:21.7.0
(and also20.11.1
)npm -v
(oryarn --version
) output:10.5.0
npm ls testdouble
(oryarn list testdouble
) version:3.20.1
Failing Test
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
var td = require('testdouble')
at the topThe text was updated successfully, but these errors were encountered: