vitest-plugin-vis 3.3.2 → 3.4.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.
@@ -3,7 +3,9 @@ export declare function getProjectName(context: {
3
3
  vite: {
4
4
  config: {
5
5
  test?: {
6
- name?: string | undefined;
6
+ name?: {
7
+ label: string;
8
+ } | string | undefined;
7
9
  };
8
10
  };
9
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/server/project.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE;YAAE,MAAM,EAAE;gBAAE,IAAI,CAAC,EAAE;oBAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;iBAAE,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,sBAElH;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE;QAAE,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,UAEhF"}
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"}
@@ -1,5 +1,12 @@
1
1
  export function getProjectName(context) {
2
- return context.project.vite.config.test?.name;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-plugin-vis",
3
- "version": "3.3.2",
3
+ "version": "3.4.0",
4
4
  "description": "Vitest visual testing plugin",
5
5
  "keywords": [
6
6
  "image-snapshot",
@@ -1,5 +1,14 @@
1
- export function getProjectName(context: { project: { vite: { config: { test?: { name?: string | undefined } } } } }) {
2
- return context.project.vite.config.test?.name
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 } } }) {