Initially virtual mocks declared in `scriptTestFrameworkScriptFile` worked not anymore
Do you want to request a feature or report a bug?
What is the current behavior? Configuration error:
I declared in scripTestFrameworkScriptFile like this
jest.mock(
'utils/xhr',
() => ({
get: () => Promise.resolve(),
post: () => Promise.resolve(),
put: () => Promise.resolve(),
delete: () => Promise.resolve(),
}),
{
virtual: true,
}
)
and also have an entry in
moduleNameMapper: {
"^utils/(.*)$": "<rootDir>/src/utils/$1",
}
When I upgraded from Jest20 to Jest 22 it started throwing this error, failing all my test cases
Could not locate module utils/xhr (mapped as /Users/xxxx/Desktop/Projects/diff-lib/xxxx/src/utils/xhr)
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.
What is the expected behavior?
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.