@daiyam/artifact-test-vitest-ts 0.5.4 → 0.5.5
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/configs/package.json
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"watch:test": "tsc-watch -p test"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@vitest/coverage-v8": "4.1.
|
|
13
|
-
"@vitest/ui": "4.1.
|
|
12
|
+
"@vitest/coverage-v8": "4.1.8",
|
|
13
|
+
"@vitest/ui": "4.1.8",
|
|
14
14
|
"@zokugun/fs-extra-plus": "0.5.0",
|
|
15
15
|
"@zokugun/xtry": "0.11.6",
|
|
16
|
-
"vitest": "4.1.
|
|
16
|
+
"vitest": "4.1.8",
|
|
17
17
|
"yaml": "2.9.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
1
2
|
import fse from '@zokugun/fs-extra-plus/sync';
|
|
2
3
|
import { xtry } from '@zokugun/xtry/sync';
|
|
3
4
|
import { expect, it } from 'vitest';
|
|
4
5
|
import YAML from 'yaml';
|
|
5
6
|
import {} from '../src/index.js';
|
|
6
7
|
|
|
8
|
+
const DEBUG = process.env.DEBUG === '1' || process.env.DEBUG === 'true' || process.env.DEBUG === 'on';
|
|
7
9
|
const ROOT = fse.join('.', 'test', 'fixtures', 'group');
|
|
8
10
|
|
|
9
11
|
const files = fse.walk(ROOT, {
|
|
@@ -31,13 +33,19 @@ for(const file of files.value) {
|
|
|
31
33
|
throw document.error;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
const
|
|
36
|
+
const { input, output } = document.value as { input: string, output: unknown };
|
|
37
|
+
|
|
38
|
+
const result = doSomething(input);
|
|
35
39
|
|
|
36
40
|
try {
|
|
37
|
-
expect(result).to.
|
|
41
|
+
expect(result.fails).to.be.false;
|
|
42
|
+
|
|
43
|
+
expect(result.value).to.eql(output);
|
|
38
44
|
}
|
|
39
45
|
catch (error) {
|
|
40
|
-
|
|
46
|
+
if(DEBUG) {
|
|
47
|
+
console.log(YAML.stringify(result));
|
|
48
|
+
}
|
|
41
49
|
|
|
42
50
|
throw error;
|
|
43
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daiyam/artifact-test-vitest-ts",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "The configuration to do unit testing with vitest and typescript.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Baptiste Augrain",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"project-template",
|
|
32
32
|
"scaffold"
|
|
33
33
|
],
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "19805320925f3b643ce19109bb14768660059465"
|
|
35
35
|
}
|