Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable */
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
return Array.from(tests).sort((testA, testB) => (testA.path > testB.path ? 1 : -1));
}
}
module.exports = CustomSequencer;
/* eslint-enable */
const TestSequencer = require('@jest/test-sequencer').default;
class CustomSequencer extends TestSequencer {
sort(tests) {
return tests.sort((testA, testB) => {
if (testA.path.indexOf('packages/installer') !== -1) {
return -1;
}
if (testB.path.indexOf('packages/installer') !== -1) {
return 1;
}
if (testA.path.indexOf('packages/forge-installer') !== -1
&& testB.path.indexOf('packages/liteloader') !== -1) {
return -1;
}
if (testB.path.indexOf('packages/forge-installer') !== -1
&& testA.path.indexOf('packages/liteloader') !== -1) {
const Sequencer = require('@jest/test-sequencer').default;
const sortByPath = (test1, test2) => {
if (test1.path < test2.path) {
return -1;
}
if (test1.path > test2.path) {
return 1;
}
return 0;
};
class ParallelCISequencer extends Sequencer {
constructor() {
super();
this.ciNodeIndex = Number(process.env.CI_NODE_INDEX || '1');
this.ciNodeTotal = Number(process.env.CI_NODE_TOTAL || '1');
/**
* Jest tests sequencer
*
* Runs our tests in alphabetical order by directory / filename.
*
* This allows us to do things like run the setup wizard tests to further bootstrap
* the testing environment for other tests.
*
* @link https://jestjs.io/docs/en/next/configuration#testsequencer-string
*/
const Sequencer = require('@jest/test-sequencer').default;
class CustomSequencer extends Sequencer {
sort( tests ) {
const copyTests = Array.from( tests );
return copyTests.sort( ( testA, testB ) => ( testA.path > testB.path ? 1 : -1 ) );
}
}
module.exports = CustomSequencer;