@daiyam/artifact-test-vitest-ts 0.5.3 → 0.5.4

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/.artifactrc.yml CHANGED
@@ -1,8 +1,26 @@
1
1
  $schema: https://raw.githubusercontent.com/zokugun/artifact/v0.6.0/schemas/v1/package.json
2
2
 
3
3
  update:
4
+ package.json:
5
+ route:
6
+ $$extend: package
7
+ patches:
8
+ - op: replace
9
+ path: /map(compose)/devDependencies/map(sort)
10
+ value:
11
+ map(filter):
12
+ '@zokugun/fs-extra-plus':
13
+ if_missing: skip
14
+ '@zokugun/xtry':
15
+ if_missing: skip
16
+ yaml:
17
+ if_missing: skip
18
+ $$default: primitive
19
+
4
20
  test/*.ts:
5
21
  if_missing: skip
6
22
  if_exists: skip
23
+
7
24
  vitest.config.ts:
25
+ if_missing: skip
8
26
  if_exists: skip
@@ -11,8 +11,9 @@
11
11
  "devDependencies": {
12
12
  "@vitest/coverage-v8": "4.1.5",
13
13
  "@vitest/ui": "4.1.5",
14
- "@zokugun/fs-extra-plus": "0.4.1",
15
- "globby": "16.2.0",
16
- "vitest": "4.1.5"
14
+ "@zokugun/fs-extra-plus": "0.5.0",
15
+ "@zokugun/xtry": "0.11.6",
16
+ "vitest": "4.1.5",
17
+ "yaml": "2.9.0"
17
18
  }
18
19
  }
@@ -0,0 +1,45 @@
1
+ import fse from '@zokugun/fs-extra-plus/sync';
2
+ import { xtry } from '@zokugun/xtry/sync';
3
+ import { expect, it } from 'vitest';
4
+ import YAML from 'yaml';
5
+ import {} from '../src/index.js';
6
+
7
+ const ROOT = fse.join('.', 'test', 'fixtures', 'group');
8
+
9
+ const files = fse.walk(ROOT, {
10
+ absolute: true,
11
+ onlyFiles: true,
12
+ collect: true,
13
+ filter: (item) => item.path.endsWith('.yml'),
14
+ });
15
+
16
+ if(files.fails) {
17
+ throw files.error;
18
+ }
19
+
20
+ for(const file of files.value) {
21
+ const name = fse.leafName(file.path, 1);
22
+
23
+ it(name, () => {
24
+ const content = fse.readFile(file.path, 'utf8');
25
+ if(content.fails) {
26
+ throw content.error;
27
+ }
28
+
29
+ const document = xtry(() => YAML.parse(content.value) as unknown);
30
+ if(document.fails) {
31
+ throw document.error;
32
+ }
33
+
34
+ const result = doSomething(document.value);
35
+
36
+ try {
37
+ expect(result).to.eql(expected);
38
+ }
39
+ catch (error) {
40
+ console.log(YAML.stringify(result));
41
+
42
+ throw error;
43
+ }
44
+ });
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daiyam/artifact-test-vitest-ts",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
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": "683cd7f6efb1c443aca7b844fdc5d43064c717a9"
34
+ "gitHead": "255ca5c31e1afdb8b419b42e637901fed5d6f756"
35
35
  }