diff --git a/jest-mongodb-config.js b/jest-mongodb-config.js new file mode 100644 index 00000000..eeebbc69 --- /dev/null +++ b/jest-mongodb-config.js @@ -0,0 +1,12 @@ +module.exports = { + mongodbMemoryServerOptions: { + instance: { + dbName: 'jest', + }, + binary: { + version: '4.0.3', + skipMD5: true, + }, + autoStart: false, + }, +}; diff --git a/src/setupTests.js b/src/setupTests.js index cb802709..84f17c0b 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -7,6 +7,12 @@ 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`, () => {}); +});