diff --git a/.gitignore b/.gitignore index 35354b04..05192b78 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,6 @@ node_modules/ npm-debug.log* yarn-debug.log* yarn-error.log* + +# Jest +globalConfig.json \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 28574873..214a6ca6 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,6 +7,7 @@ module.exports = { preset: '@shelf/jest-mongodb', setupFilesAfterEnv: ['/src/setupTests.js'], testPathIgnorePatterns: ['/node_modules/', '/.next/'], + watchPathIgnorePatterns: ['/globalConfig.json'], transform: { '^.+\\.(js|jsx|ts|tsx)$': '/node_modules/babel-jest', '^.+\\.css$': '/config/jest/cssTransform.js', diff --git a/src/setupTests.js b/src/setupTests.js index 84f17c0b..cb802709 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -7,12 +7,6 @@ import '@testing-library/jest-dom/extend-expect'; -import fs from 'fs'; import fetchMock from 'jest-fetch-mock'; fetchMock.enableMocks(); - -afterAll(() => { - // Unlink config used in jest-mongodb - fs.unlink(`${process.cwd()}/globalConfig.json`, () => {}); -});