@argos-ci/vitest 0.3.1 → 0.3.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/plugin.d.mts CHANGED
@@ -11,7 +11,13 @@ import { Reporter } from "vitest/reporters";
11
11
  * Configuration for the Argos Vitest reporter.
12
12
  * @see https://js-sdk-reference.argos-ci.com/interfaces/UploadParameters.html
13
13
  */
14
- type ArgosReporterConfig = UploadParameters;
14
+ interface ArgosReporterConfig extends UploadParameters {
15
+ /**
16
+ * If true, the reporter will not fail the test run when the upload fails.
17
+ * @default false
18
+ */
19
+ ignoreUploadFailures?: boolean;
20
+ }
15
21
  /**
16
22
  * Options passed when calling `argosScreenshot` from a browser test.
17
23
  *
package/dist/plugin.mjs CHANGED
@@ -337,17 +337,25 @@ var ArgosReporter = class {
337
337
  }
338
338
  async onTestRunEnd() {
339
339
  if (this.vitest.config.watch) return;
340
- const res = await upload({
341
- files: [
342
- "**/*.png",
343
- "**/*.aria.yml",
344
- "**/*.snapshot.*"
345
- ],
346
- ignore: ["**/*.argos.json"],
347
- parallel: await getParallelFromConfig(this.vitest.config) ?? void 0,
348
- ...this.config
349
- });
350
- console.log(`✅ Argos build created: ${res.build.url}`);
340
+ const { ignoreUploadFailures, ...uploadParameters } = this.config;
341
+ try {
342
+ const res = await upload({
343
+ files: [
344
+ "**/*.png",
345
+ "**/*.aria.yml",
346
+ "**/*.snapshot.*"
347
+ ],
348
+ ignore: ["**/*.argos.json"],
349
+ parallel: await getParallelFromConfig(this.vitest.config) ?? void 0,
350
+ ...uploadParameters
351
+ });
352
+ console.log(`✅ Argos build created: ${res.build.url}`);
353
+ } catch (error) {
354
+ console.error(`❌ Error while creating the Argos build`);
355
+ console.error(error);
356
+ if (ignoreUploadFailures) console.warn("⚠️ Upload failure ignored due to the `ignoreUploadFailures` option");
357
+ else process.exitCode = 1;
358
+ }
351
359
  }
352
360
  };
353
361
  //#endregion
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.3.1",
4
+ "version": "0.3.2",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -52,8 +52,8 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@argos-ci/browser": "6.4.4",
55
- "@argos-ci/core": "6.6.1",
56
- "@argos-ci/playwright": "7.3.6",
55
+ "@argos-ci/core": "6.6.2",
56
+ "@argos-ci/playwright": "7.3.7",
57
57
  "@argos-ci/util": "4.0.4"
58
58
  },
59
59
  "peerDependencies": {
@@ -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": "e6b1b39775bc210c6b8fec81c59165c5a4aa4dc9"
84
+ "gitHead": "a86f2dc1a243591e064a2d5c4e03d712c8f03b86"
85
85
  }