diff --git a/jest.config.ts b/jest.config.ts index 889f7dfc..0f491169 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -8,7 +8,7 @@ const defaultEsmPreset = createDefaultEsmPreset(); const config: Config = { testEnvironment: 'node', testMatch: ['/test/**/*-test.ts'], - setupFiles: ['/test/jest.setup.ts'], + setupFiles: ['/test/jest.setup.cjs'], ...defaultEsmPreset, moduleNameMapper: { '^(\\.{1,2}/.*)\\.js$': '$1', diff --git a/test/jest.setup.ts b/test/jest.setup.cjs similarity index 51% rename from test/jest.setup.ts rename to test/jest.setup.cjs index 99141b16..82c48591 100644 --- a/test/jest.setup.ts +++ b/test/jest.setup.cjs @@ -1,6 +1,6 @@ -import os from 'node:os'; -import sinon from 'sinon'; +const os = require('node:os'); +const sinon = require('sinon'); -export default function () { +module.exports = function () { sinon.stub(os, 'EOL').value('\n'); // Stub os.EOL to always be '\n' for testing/snapshot purposes. -} +};