@naturalcycles/dev-lib 16.6.3 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cfg/vitest.config.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
|
|
3
|
+
import { VitestAlphabeticSequencer } from './vitestAlphabeticSequencer.mjs'
|
|
3
4
|
const runsInIDE = doesItRunInIDE()
|
|
4
5
|
const testType = getTestType(runsInIDE)
|
|
5
6
|
const silent = shouldBeSilent(runsInIDE)
|
|
@@ -46,12 +47,12 @@ export const sharedConfig = {
|
|
|
46
47
|
logHeapUsage: true,
|
|
47
48
|
testTimeout: 60_000,
|
|
48
49
|
sequence: {
|
|
49
|
-
|
|
50
|
-
shuffle: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
seed: 1, // this makes the order of tests deterministic (but still not alphabetic)
|
|
50
|
+
sequencer: VitestAlphabeticSequencer,
|
|
51
|
+
// shuffle: {
|
|
52
|
+
// files: true,
|
|
53
|
+
// tests: false,
|
|
54
|
+
// },
|
|
55
|
+
// seed: 1, // this makes the order of tests deterministic (but still not alphabetic)
|
|
55
56
|
},
|
|
56
57
|
include,
|
|
57
58
|
exclude,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseSequencer } from 'vitest/node'
|
|
2
|
+
import { _sortBy } from '@naturalcycles/js-lib'
|
|
3
|
+
|
|
4
|
+
export class VitestAlphabeticSequencer extends BaseSequencer {
|
|
5
|
+
async sort(files) {
|
|
6
|
+
// console.log('sort', files.length)
|
|
7
|
+
return _sortBy(files, f => f.moduleId)
|
|
8
|
+
}
|
|
9
|
+
// Sharding method is untouched for now
|
|
10
|
+
// async shard(files){
|
|
11
|
+
// console.log('shard', files.length)
|
|
12
|
+
// return files
|
|
13
|
+
// }
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/dev-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepare": "husky",
|
|
6
6
|
"tsn-debug": "tsx scripts/testScript.ts",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"@commitlint/config-conventional": "^19",
|
|
24
24
|
"@eslint/js": "^9",
|
|
25
25
|
"@inquirer/prompts": "^7",
|
|
26
|
-
"@naturalcycles/cli": "^1",
|
|
27
26
|
"@naturalcycles/js-lib": "^14",
|
|
28
27
|
"@naturalcycles/nodejs-lib": "^13",
|
|
29
28
|
"@stylistic/eslint-plugin": "^4",
|