jest-import-spy
v1.5.0
Published
Observe module imports in Jest tests
Downloads
38
Readme
Enables inspecting imports in Jest tests
Usage
// Jest config
{
"runtime": "jest-import-spy"
}
import {collectImports} from 'jest-import-spy';
test('imports', () => {
const imports = collectImports(() => {
jest.isolateModules(() => {
require('./src');
});
});
expect(imports).toEqual(['./src/index.js', './src/utils.js', 'lodash']);
});