Skip to content

Commit de38167

Browse files
committed
Use manual mock factory for isbinaryfile to avoid ESM parse error
jest.mock('isbinaryfile') without a factory still attempts to parse the real ESM module for auto-mocking. Provide an explicit factory function so Jest never loads the real module.
1 parent 92d851a commit de38167

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/unit/app.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jest.mock('child_process');
1010
jest.mock('systeminformation');
1111
jest.mock('js-yaml');
1212
jest.mock('readdirp');
13-
jest.mock('isbinaryfile');
13+
jest.mock('isbinaryfile', () => ({
14+
isBinaryFile: jest.fn(),
15+
}));
1416

1517
describe('NetbootXYZ WebApp', () => {
1618
let app;

0 commit comments

Comments
 (0)