diff --git a/e2e/jest.config.js b/e2e/jest.config.js index 560e26f47..114e29ec2 100644 --- a/e2e/jest.config.js +++ b/e2e/jest.config.js @@ -1,7 +1,8 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { rootDir: '..', - testMatch: ['/e2e/tests/**/*.spec.ts'], + testSequencer: '/e2e/testSequencer.js', + testMatch: ['/e2e/tests/assorted/*.spec.ts'], testTimeout: 120000, maxWorkers: 1, globalSetup: '/e2e/globalSetup.ts', diff --git a/e2e/testSequencer.js b/e2e/testSequencer.js new file mode 100644 index 000000000..1b60c5f6e --- /dev/null +++ b/e2e/testSequencer.js @@ -0,0 +1,12 @@ +const Sequencer = require('@jest/test-sequencer').default; + +class CustomSequencer extends Sequencer { + sort(tests) { + // Test structure information + // https://github.com/facebook/jest/blob/6b8b1404a1d9254e7d5d90a8934087a9c9899dab/packages/jest-runner/src/types.ts#L17-L21 + const copyTests = Array.from(tests); + return copyTests.sort((testA, testB) => (testA.path > testB.path ? 1 : -1)); + } +} + +module.exports = CustomSequencer;