Skip to content

Commit

Permalink
chore: run tests 10 times
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab committed Jun 28, 2024
1 parent f6da09b commit e1362ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export default {
preset: 'ts-jest',
testEnvironment: 'node',
setupFilesAfterEnv: ['./jest.setup.js'],
testMatch: ['**/tests/**/*.test.ts', '**/?(*.)+(spec|test).ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
Expand Down
16 changes: 16 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const originalTest = global.test;
const NUM_ITERATIONS = 10;

global.test = (name, fn, timeout) => {
for (let i = 0; i < NUM_ITERATIONS; i++) {
originalTest(`${name} (iteration ${i + 1})`, fn, timeout);
}
};

const originalIt = global.it;

global.it = (name, fn, timeout) => {
for (let i = 0; i < NUM_ITERATIONS; i++) {
originalIt(`${name} (iteration ${i + 1})`, fn, timeout);
}
};

0 comments on commit e1362ac

Please sign in to comment.