0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/integration-tests/ui-test-sequencer.js

20 lines
600 B
JavaScript
Raw Normal View History

import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const Sequencer = require('@jest/test-sequencer').default;
const bootstrapTestSuitePathSuffix = '/bootstrap.test.js';
class CustomSequencer extends Sequencer {
sort(tests) {
// Let the bootstrap test suite does its job first
const bootstrap = tests.filter(({ path }) => path.endsWith(bootstrapTestSuitePathSuffix));
return [
...bootstrap,
...tests.filter(({ path }) => !path.endsWith(bootstrapTestSuitePathSuffix)),
].filter(Boolean);
}
}
export default CustomSequencer;