Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 404 Bytes

README.md

File metadata and controls

23 lines (19 loc) · 404 Bytes

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']);
});