@argos-ci/vitest 0.4.1 → 0.4.2

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/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
+ import "@argos-ci/core";
1
2
  import { ScreenshotMetadata } from "@argos-ci/util";
2
3
  import { ArgosAttachment } from "@argos-ci/playwright";
3
4
  import { StabilizationPluginOptions, ViewportOption } from "@argos-ci/browser";
4
-
5
5
  //#region src/metadata.d.ts
6
6
  /** The `test` slice of {@link ScreenshotMetadata}. */
7
7
  type TestMetadata = ScreenshotMetadata["test"];
package/dist/index.mjs CHANGED
@@ -138,7 +138,7 @@ async function getTestMetadata() {
138
138
  return buildTestMetadata(task);
139
139
  }
140
140
  //#endregion
141
- //#region ../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.js
141
+ //#region ../../node_modules/.pnpm/tinyrainbow@3.1.1/node_modules/tinyrainbow/dist/index.js
142
142
  var b = {
143
143
  reset: [0, 0],
144
144
  bold: [
@@ -221,7 +221,7 @@ function C({ force: e } = {}) {
221
221
  }
222
222
  var y = C();
223
223
  //#endregion
224
- //#region ../../node_modules/.pnpm/@vitest+pretty-format@4.1.9/node_modules/@vitest/pretty-format/dist/index.js
224
+ //#region ../../node_modules/.pnpm/@vitest+pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.js
225
225
  function _mergeNamespaces(n, m) {
226
226
  m.forEach(function(e) {
227
227
  e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
@@ -1188,7 +1188,7 @@ async function argosSnapshot(content, options = {}) {
1188
1188
  const { server } = await import("vitest/browser");
1189
1189
  return server.commands.argosSnapshot(resolvedName, serialized, serializableOptions, test);
1190
1190
  }
1191
- const { writeSnapshotFile } = await import("./snapshot-file-DYQmhYf1.mjs");
1191
+ const { writeSnapshotFile } = await import("./snapshot-file-D8dL3z_T.mjs");
1192
1192
  return writeSnapshotFile(resolvedName, serialized, serializableOptions, test);
1193
1193
  }
1194
1194
  /**
@@ -1,7 +1,6 @@
1
1
  import { ArgosAttachment, ArgosScreenshotOptions } from "@argos-ci/playwright";
2
2
  import { BrowserCommandContext } from "vitest/node";
3
3
  import { ViewportSize } from "@argos-ci/browser";
4
-
5
4
  //#region src/iframe.d.ts
6
5
  /**
7
6
  * Selector of the iframe Vitest renders the test into on the orchestrator page.
package/dist/internal.mjs CHANGED
@@ -130,7 +130,8 @@ async function screenshotFrame(ctx, name, options, config) {
130
130
  await fitIframeToContent(ctx, { fitWidth: config.fitWidth });
131
131
  }
132
132
  };
133
- return argosScreenshot(await ctx.frame(), name, playwrightOptions);
133
+ const frame = await ctx.frame();
134
+ return argosScreenshot(frame, name, playwrightOptions);
134
135
  }
135
136
  //#endregion
136
137
  //#region src/version.ts
@@ -139,7 +140,8 @@ const require = createRequire(import.meta.url);
139
140
  * Get the version of the Argos Vitest SDK.
140
141
  */
141
142
  async function getArgosVitestVersion() {
142
- return readVersionFromPackage(require.resolve("@argos-ci/vitest/package.json"));
143
+ const pkgPath = require.resolve("@argos-ci/vitest/package.json");
144
+ return readVersionFromPackage(pkgPath);
143
145
  }
144
146
  //#endregion
145
147
  export { VITEST_IFRAME_SELECTOR, VITEST_TESTER_ID, fitIframeToContent, getArgosVitestVersion, resetTesterScale, screenshotFrame, setIframeViewportSize };
package/dist/plugin.d.mts CHANGED
@@ -5,7 +5,6 @@ import { UploadParameters } from "@argos-ci/core";
5
5
  import { Plugin } from "vitest/config";
6
6
  import { BrowserCommand, Vitest } from "vitest/node";
7
7
  import { Reporter } from "vitest/reporters";
8
-
9
8
  //#region src/options.d.ts
10
9
  /**
11
10
  * Configuration for the Argos Vitest reporter.
package/dist/plugin.mjs CHANGED
@@ -134,7 +134,8 @@ async function screenshotFrame(ctx, name, options, config) {
134
134
  await fitIframeToContent(ctx, { fitWidth: config.fitWidth });
135
135
  }
136
136
  };
137
- return argosScreenshot(await ctx.frame(), name, playwrightOptions);
137
+ const frame = await ctx.frame();
138
+ return argosScreenshot(frame, name, playwrightOptions);
138
139
  }
139
140
  //#endregion
140
141
  //#region src/version.ts
@@ -143,14 +144,16 @@ const require = createRequire(import.meta.url);
143
144
  * Get the version of the Argos Vitest SDK.
144
145
  */
145
146
  async function getArgosVitestVersion() {
146
- return readVersionFromPackage(require.resolve("@argos-ci/vitest/package.json"));
147
+ const pkgPath = require.resolve("@argos-ci/vitest/package.json");
148
+ return readVersionFromPackage(pkgPath);
147
149
  }
148
150
  /**
149
151
  * Get the version of Vitest itself (used as the automation library for
150
152
  * `argosSnapshot`, which does not rely on a browser).
151
153
  */
152
154
  async function getVitestVersion() {
153
- return readVersionFromPackage(require.resolve("vitest/package.json"));
155
+ const pkgPath = require.resolve("vitest/package.json");
156
+ return readVersionFromPackage(pkgPath);
154
157
  }
155
158
  //#endregion
156
159
  //#region src/command.ts
@@ -254,7 +257,8 @@ async function writeSnapshotFile(name, content, options = {}, test) {
254
257
  if (!name) throw new Error("The `name` argument is required.");
255
258
  const root = options.root ?? "./snapshots";
256
259
  const extension = normalizeExtension(options.extension ?? DEFAULT_EXTENSION);
257
- const snapshotPath = resolve(root, `${getScreenshotName(name)}${SNAPSHOT_INFIX}${extension}`);
260
+ const filename = `${getScreenshotName(name)}${SNAPSHOT_INFIX}${extension}`;
261
+ const snapshotPath = resolve(root, filename);
258
262
  const [vitestVersion, sdkVersion, resolvedTest] = await Promise.all([
259
263
  getVitestVersion(),
260
264
  getArgosVitestVersion(),
@@ -343,6 +347,7 @@ var ArgosReporter = class {
343
347
  if (this.vitest.config.watch) return;
344
348
  const { ignoreUploadFailures, ...uploadParameters } = this.config;
345
349
  try {
350
+ const parallel = await getParallelFromConfig(this.vitest.config);
346
351
  const res = await upload({
347
352
  files: [
348
353
  "**/*.png",
@@ -350,7 +355,7 @@ var ArgosReporter = class {
350
355
  "**/*.snapshot.*"
351
356
  ],
352
357
  ignore: ["**/*.argos.json"],
353
- parallel: await getParallelFromConfig(this.vitest.config) ?? void 0,
358
+ parallel: parallel ?? void 0,
354
359
  ...uploadParameters
355
360
  });
356
361
  console.log(`✅ Argos build created: ${res.build.url}`);
@@ -9,14 +9,16 @@ const require = createRequire(import.meta.url);
9
9
  * Get the version of the Argos Vitest SDK.
10
10
  */
11
11
  async function getArgosVitestVersion() {
12
- return readVersionFromPackage(require.resolve("@argos-ci/vitest/package.json"));
12
+ const pkgPath = require.resolve("@argos-ci/vitest/package.json");
13
+ return readVersionFromPackage(pkgPath);
13
14
  }
14
15
  /**
15
16
  * Get the version of Vitest itself (used as the automation library for
16
17
  * `argosSnapshot`, which does not rely on a browser).
17
18
  */
18
19
  async function getVitestVersion() {
19
- return readVersionFromPackage(require.resolve("vitest/package.json"));
20
+ const pkgPath = require.resolve("vitest/package.json");
21
+ return readVersionFromPackage(pkgPath);
20
22
  }
21
23
  //#endregion
22
24
  //#region src/snapshot-file.ts
@@ -62,7 +64,8 @@ async function writeSnapshotFile(name, content, options = {}, test) {
62
64
  if (!name) throw new Error("The `name` argument is required.");
63
65
  const root = options.root ?? "./snapshots";
64
66
  const extension = normalizeExtension(options.extension ?? DEFAULT_EXTENSION);
65
- const snapshotPath = resolve(root, `${getScreenshotName(name)}${SNAPSHOT_INFIX}${extension}`);
67
+ const filename = `${getScreenshotName(name)}${SNAPSHOT_INFIX}${extension}`;
68
+ const snapshotPath = resolve(root, filename);
66
69
  const [vitestVersion, sdkVersion, resolvedTest] = await Promise.all([
67
70
  getVitestVersion(),
68
71
  getArgosVitestVersion(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/vitest",
3
3
  "description": "Vitest SDK for visual testing with Argos.",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -51,9 +51,9 @@
51
51
  "node": ">=22.0.0"
52
52
  },
53
53
  "dependencies": {
54
- "@argos-ci/browser": "6.4.4",
55
- "@argos-ci/core": "6.7.1",
56
- "@argos-ci/playwright": "7.4.1",
54
+ "@argos-ci/browser": "6.4.5",
55
+ "@argos-ci/core": "6.7.2",
56
+ "@argos-ci/playwright": "7.4.2",
57
57
  "@argos-ci/util": "4.1.0"
58
58
  },
59
59
  "peerDependencies": {
@@ -64,10 +64,10 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/node": "catalog:",
67
- "@vitest/browser": "^4.1.9",
68
- "@vitest/browser-playwright": "^4.1.9",
69
- "@vitest/pretty-format": "^4.1.9",
70
- "playwright": "^1.61.0",
67
+ "@vitest/browser": "^4.1.10",
68
+ "@vitest/browser-playwright": "^4.1.10",
69
+ "@vitest/pretty-format": "^4.1.10",
70
+ "playwright": "^1.62.1",
71
71
  "vitest": "catalog:"
72
72
  },
73
73
  "scripts": {
@@ -81,5 +81,5 @@
81
81
  "check-format": "prettier --check --ignore-unknown --ignore-path=./.gitignore --ignore-path=../../.gitignore --ignore-path=../../.prettierignore .",
82
82
  "lint": "eslint ."
83
83
  },
84
- "gitHead": "3fd83ec12c4e291e813c91cd1e2d4737d014a1d0"
84
+ "gitHead": "3268a9ff953f019494367e3bf87ea520268b6ed2"
85
85
  }