vitest-plugin-vis 3.3.2 → 3.4.1
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/esm/server/project.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/server/project.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/server/project.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,OAAO,EAAE;IACvC,OAAO,EAAE;QAAE,IAAI,EAAE;YAAE,MAAM,EAAE;gBAAE,IAAI,CAAC,EAAE;oBAAE,IAAI,CAAC,EAAE;wBAAE,KAAK,EAAE,MAAM,CAAA;qBAAE,GAAG,MAAM,GAAG,SAAS,CAAA;iBAAE,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAA;CAC3F,sBASA;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE;QAAE,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,UAEhF"}
|
package/esm/server/project.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export function getProjectName(context) {
|
|
2
|
-
|
|
2
|
+
const name = context.project.vite.config.test?.name;
|
|
3
|
+
if (typeof name === 'string') {
|
|
4
|
+
return name;
|
|
5
|
+
}
|
|
6
|
+
if (typeof name === 'object' && 'label' in name) {
|
|
7
|
+
return name.label;
|
|
8
|
+
}
|
|
9
|
+
return undefined;
|
|
3
10
|
}
|
|
4
11
|
export function getProjectRoot(context) {
|
|
5
12
|
return context.project.config.root;
|
package/esm/shared/types.d.ts
CHANGED
|
@@ -27,7 +27,21 @@ export type FailureThresholdOptions = {
|
|
|
27
27
|
/**
|
|
28
28
|
* Failure tolerance threshold.
|
|
29
29
|
*
|
|
30
|
+
* If `failureThresholdType` is `pixel`, the value is the number of pixels that are allowed to be different.
|
|
31
|
+
* If `failureThresholdType` is `percent`, the value is the percentage of pixels that are allowed to be different.
|
|
32
|
+
*
|
|
30
33
|
* Default is `0`.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // Allow 10 pixels to be different
|
|
38
|
+
* failureThresholdType: 'pixel'
|
|
39
|
+
* failureThreshold: 10
|
|
40
|
+
*
|
|
41
|
+
* // Allow 10% of pixels to be different
|
|
42
|
+
* failureThresholdType: 'percent'
|
|
43
|
+
* failureThreshold: 10
|
|
44
|
+
* ```
|
|
31
45
|
*/
|
|
32
46
|
failureThreshold?: number | undefined;
|
|
33
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,2BAA2B;IAC3C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,CAAA;AAE/C,MAAM,MAAM,uBAAuB,GAAG;IACrC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IACtD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA,OA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,SAAS,MAAM,GAC9F,qBAAqB,CAAC,CAAC,CAAC,GACxB,sBAAsB,CAAC,CAAC,CAAC,CAAC,GAC5B,uBAAuB,CAAA;AAExB,MAAM,MAAM,2BAA2B,GAAG;IACzC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,CAAA;AACD,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,gBAAgB,GAAG,OAAO,IAAI,2BAA2B,GAC1G,uBAAuB,GACvB,2BAA2B,CAAC,CAAC,CAAC,GAAG;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAClC,CAAA;AAEF,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,MAAM,MAAM,+BAA+B,CAAC,CAAC,SAAS,gBAAgB,GAAG,OAAO,IAAI,2BAA2B,CAAC,CAAC,CAAC,GACjH,wBAAwB,CAAA;AAEzB,MAAM,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE;QACL,CAAC,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAA;KACvC,CAAA;CACD,CAAA"}
|
package/package.json
CHANGED
package/src/server/project.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
export function getProjectName(context: {
|
|
2
|
-
|
|
1
|
+
export function getProjectName(context: {
|
|
2
|
+
project: { vite: { config: { test?: { name?: { label: string } | string | undefined } } } }
|
|
3
|
+
}) {
|
|
4
|
+
const name = context.project.vite.config.test?.name
|
|
5
|
+
if (typeof name === 'string') {
|
|
6
|
+
return name
|
|
7
|
+
}
|
|
8
|
+
if (typeof name === 'object' && 'label' in name) {
|
|
9
|
+
return name.label
|
|
10
|
+
}
|
|
11
|
+
return undefined
|
|
3
12
|
}
|
|
4
13
|
|
|
5
14
|
export function getProjectRoot(context: { project: { config: { root: string } } }) {
|
package/src/shared/types.ts
CHANGED
|
@@ -31,7 +31,21 @@ export type FailureThresholdOptions = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Failure tolerance threshold.
|
|
33
33
|
*
|
|
34
|
+
* If `failureThresholdType` is `pixel`, the value is the number of pixels that are allowed to be different.
|
|
35
|
+
* If `failureThresholdType` is `percent`, the value is the percentage of pixels that are allowed to be different.
|
|
36
|
+
*
|
|
34
37
|
* Default is `0`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* // Allow 10 pixels to be different
|
|
42
|
+
* failureThresholdType: 'pixel'
|
|
43
|
+
* failureThreshold: 10
|
|
44
|
+
*
|
|
45
|
+
* // Allow 10% of pixels to be different
|
|
46
|
+
* failureThresholdType: 'percent'
|
|
47
|
+
* failureThreshold: 10
|
|
48
|
+
* ```
|
|
35
49
|
*/
|
|
36
50
|
failureThreshold?: number | undefined
|
|
37
51
|
}
|