vitest-plugin-vis 5.1.2 → 5.1.3

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.
@@ -4,7 +4,7 @@ if (globalThis.__vitest_browser__) import("vitest/browser").then((m) => {
4
4
  ctx = m;
5
5
  });
6
6
  const server = new Proxy({}, { get(target, prop) {
7
- return target[prop] ?? (ctx?.server)[prop];
7
+ return target[prop] ?? (ctx?.server)?.[prop];
8
8
  } });
9
9
 
10
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"vitest_browser_context_proxy.mjs","names":[],"sources":["../../../../src/client/external/vitest/vitest_browser_context_proxy.ts"],"sourcesContent":["import type { SerializedConfig } from 'vitest'\nimport type { BrowserCommands } from 'vitest/browser'\n\nlet ctx: Awaited<typeof import('vitest/browser')>\n\nif ((globalThis as any).__vitest_browser__) {\n\timport('vitest/browser').then((m) => {\n\t\tctx = m\n\t})\n}\n\nexport const server = new Proxy<{\n\t/**\n\t * Platform the Vitest server is running on.\n\t * The same as calling `process.platform` on the server.\n\t */\n\tplatform: string\n\t/**\n\t * Runtime version of the Vitest server.\n\t * The same as calling `process.version` on the server.\n\t */\n\tversion: string\n\t/**\n\t * Name of the browser provider.\n\t */\n\tprovider: string\n\t/**\n\t * Name of the current browser.\n\t */\n\tbrowser: string\n\t/**\n\t * Available commands for the browser.\n\t * @see {@link https://vitest.dev/guide/browser/commands}\n\t */\n\tcommands: BrowserCommands\n\t/**\n\t * Serialized test config.\n\t */\n\tconfig: SerializedConfig\n}>({} as any, {\n\tget(target, prop) {\n\t\treturn (target as any)[prop] ?? (ctx?.server as any)[prop]\n\t},\n})\n"],"mappings":";AAGA,IAAI;AAEJ,IAAK,WAAmB,mBACvB,QAAO,kBAAkB,MAAM,MAAM;AACpC,OAAM;EACL;AAGH,MAAa,SAAS,IAAI,MA4BvB,EAAE,EAAS,EACb,IAAI,QAAQ,MAAM;AACjB,QAAQ,OAAe,UAAU,KAAK,QAAe;GAEtD,CAAC"}
1
+ {"version":3,"file":"vitest_browser_context_proxy.mjs","names":[],"sources":["../../../../src/client/external/vitest/vitest_browser_context_proxy.ts"],"sourcesContent":["import type { SerializedConfig } from 'vitest'\nimport type { BrowserCommands } from 'vitest/browser'\n\nlet ctx: Awaited<typeof import('vitest/browser')>\n\nif ((globalThis as any).__vitest_browser__) {\n\timport('vitest/browser').then((m) => {\n\t\tctx = m\n\t})\n}\n\nexport const server = new Proxy<{\n\t/**\n\t * Platform the Vitest server is running on.\n\t * The same as calling `process.platform` on the server.\n\t */\n\tplatform: string\n\t/**\n\t * Runtime version of the Vitest server.\n\t * The same as calling `process.version` on the server.\n\t */\n\tversion: string\n\t/**\n\t * Name of the browser provider.\n\t */\n\tprovider: string\n\t/**\n\t * Name of the current browser.\n\t */\n\tbrowser: string\n\t/**\n\t * Available commands for the browser.\n\t * @see {@link https://vitest.dev/guide/browser/commands}\n\t */\n\tcommands: BrowserCommands\n\t/**\n\t * Serialized test config.\n\t */\n\tconfig: SerializedConfig\n}>({} as any, {\n\tget(target, prop) {\n\t\treturn (target as any)[prop] ?? (ctx?.server as any)?.[prop]\n\t},\n})\n"],"mappings":";AAGA,IAAI;AAEJ,IAAK,WAAmB,mBACvB,QAAO,kBAAkB,MAAM,MAAM;AACpC,OAAM;EACL;AAGH,MAAa,SAAS,IAAI,MA4BvB,EAAE,EAAS,EACb,IAAI,QAAQ,MAAM;AACjB,QAAQ,OAAe,UAAU,KAAK,UAAiB;GAExD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-plugin-vis",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Vitest visual testing plugin",
5
5
  "keywords": [
6
6
  "image-snapshot",
@@ -39,6 +39,6 @@ export const server = new Proxy<{
39
39
  config: SerializedConfig
40
40
  }>({} as any, {
41
41
  get(target, prop) {
42
- return (target as any)[prop] ?? (ctx?.server as any)[prop]
42
+ return (target as any)[prop] ?? (ctx?.server as any)?.[prop]
43
43
  },
44
44
  })