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
jest.mock('args',()=>({}))require('./router')// add router module to require.cacheconstloadUncached=require('load-uncached')describe('test load-uncached',()=>{afterAll(()=>{jest.resetModules()})it('should throw error when mock config file does not exist',()=>{expect(()=>loadUncached('xxx')).toThrow(/xxx/)})it('should require uncached module',()=>{constmoduleExport=loadUncached('../src/args')expect(moduleExport).toEqual({})})})
What is the current behavior?
it seems that require.cache always be {} in load-uncached.js.
What is the expected behavior?
require.cache in load-uncached.js should be {router: ...} when require('router') in load-uncached.test.js.
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.
A bug?
here is
load-uncached.js
here is
load-uncached.test.js
:What is the current behavior?
it seems that
require.cache
always be{}
inload-uncached.js
.What is the expected behavior?
require.cache
inload-uncached.js
should be{router: ...}
whenrequire('router')
inload-uncached.test.js
.my jest configuration in
package.json
:jest: v22.4.2
npm: v5.5.1
node: v9.3.0
os: v10.12.3
The text was updated successfully, but these errors were encountered: