-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathvitest.config.ts
More file actions
37 lines (32 loc) · 1001 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
37 lines (32 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig } from "vitest/config";
import { BaseSequencer } from "vitest/node";
// Custom sequencer that puts kubectl.test.ts at the end
class KubectlSequencer extends BaseSequencer {
// Override the sort method to place kubectl tests last
async sort(files) {
// Get default sorted files
const sortedFiles = await super.sort(files);
sortedFiles.forEach((file) => {
console.log(file.moduleId);
});
// Split into kubectl tests and other tests
const kubectlTests = sortedFiles.filter((f) =>
f.moduleId.includes("kubectl.test.ts")
);
const otherTests = sortedFiles.filter(
(f) => !f.moduleId.includes("kubectl.test.ts")
);
// Return other tests first, then kubectl tests
return [...otherTests, ...kubectlTests];
}
}
export default defineConfig({
test: {
testTimeout: 120000,
hookTimeout: 60000,
exclude: ["dist/**/*", "node_modules/**/*"],
sequence: {
sequencer: KubectlSequencer,
},
},
});