Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/node-integration-tests/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const baseConfig = require('../../jest.config.js');

module.exports = {
globalSetup: '<rootDir>/setup-tests.ts',
...baseConfig,
testMatch: ['**/test.ts'],
};
2 changes: 1 addition & 1 deletion packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:prettier": "prettier --check \"{suites,utils}/**/*.ts\"",
"type-check": "tsc",
"test": "jest --detectOpenHandles --runInBand --forceExit",
"test": "jest --runInBand --forceExit",
"test:watch": "yarn test --watch"
},
"dependencies": {
Expand Down
12 changes: 12 additions & 0 deletions packages/node-integration-tests/setup-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import EventEmitter from 'events';

const setup = async (): Promise<void> => {
// Node warns about a potential memory leak
// when more than 10 event listeners are assigned inside a single thread.
// Initializing Sentry for each test triggers these warnings after 10th test inside Jest thread.
// As we know that it's not a memory leak and number of listeners are limited to the number of tests,
// removing the limit on listener count here.
EventEmitter.defaultMaxListeners = 0;
};

export default setup;