Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 26, 2020 12:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save velotiotech/c57a65bb5856873fa95c29d6ef180755 to your computer and use it in GitHub Desktop.
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment