@argos-ci/core 0.11.0 → 0.12.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.
package/dist/index.d.ts CHANGED
@@ -24,6 +24,10 @@ interface UploadParameters {
24
24
  /** The number of parallel nodes being ran */
25
25
  total: number;
26
26
  } | false;
27
+ /** Branch used as baseline for screenshot comparison */
28
+ referenceBranch?: string;
29
+ /** Commit used as baseline for screenshot comparison */
30
+ referenceCommit?: string;
27
31
  }
28
32
  /**
29
33
  * Upload screenshots to argos-ci.com.
package/dist/index.mjs CHANGED
@@ -30,7 +30,7 @@ const mustBeCommit = (value)=>{
30
30
  };
31
31
  const mustBeArgosToken = (value)=>{
32
32
  if (value && value.length !== 40) {
33
- throw new Error("Must be a valid Argos repository token");
33
+ throw new Error("Invalid Argos repository token (must be 40 characters)");
34
34
  }
35
35
  };
36
36
  const schema = {
@@ -89,6 +89,18 @@ const schema = {
89
89
  default: null,
90
90
  nullable: true
91
91
  },
92
+ referenceBranch: {
93
+ env: "ARGOS_REFERENCE_BRANCH",
94
+ format: String,
95
+ default: null,
96
+ nullable: true
97
+ },
98
+ referenceCommit: {
99
+ env: "ARGOS_REFERENCE_COMMIT",
100
+ format: String,
101
+ default: null,
102
+ nullable: true
103
+ },
92
104
  ciService: {
93
105
  format: String,
94
106
  default: null,
@@ -512,6 +524,8 @@ const getConfigFromOptions = (options)=>{
512
524
  buildName: options.buildName ?? config.get("buildName") ?? null,
513
525
  prNumber: options.prNumber ?? config.get("prNumber") ?? ciEnv?.prNumber ?? null,
514
526
  prHeadCommit: config.get("prHeadCommit") ?? ciEnv?.prHeadCommit ?? null,
527
+ referenceBranch: options.referenceBranch ?? config.get("referenceBranch") ?? null,
528
+ referenceCommit: options.referenceCommit ?? config.get("referenceCommit") ?? null,
515
529
  ciService: ciEnv?.name ?? null,
516
530
  owner: ciEnv?.owner ?? null,
517
531
  repository: ciEnv?.repository ?? null,
@@ -568,7 +582,9 @@ const getConfigFromOptions = (options)=>{
568
582
  parallelNonce: config.parallelNonce,
569
583
  screenshotKeys: Array.from(new Set(screenshots.map((screenshot)=>screenshot.hash))),
570
584
  prNumber: config.prNumber,
571
- prHeadCommit: config.prHeadCommit
585
+ prHeadCommit: config.prHeadCommit,
586
+ referenceBranch: config.referenceBranch,
587
+ referenceCommit: config.referenceCommit
572
588
  });
573
589
  debug("Got screenshots", result);
574
590
  debug(`Split screenshots in chunks of ${CHUNK_SIZE}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/core",
3
3
  "description": "Visual testing solution to avoid visual regression. The core component of Argos SDK that handles build creation.",
4
- "version": "0.11.0",
4
+ "version": "0.12.0",
5
5
  "scripts": {
6
6
  "prebuild": "rm -rf dist",
7
7
  "build": "rollup -c",
@@ -61,5 +61,5 @@
61
61
  "rollup-plugin-dts": "^6.0.1",
62
62
  "rollup-plugin-swc3": "^0.10.1"
63
63
  },
64
- "gitHead": "75d2c0c4dc539dd294d33fb67512ee332186ebeb"
64
+ "gitHead": "e58b26f5c3a9998d89353c4435aa742b5ae3d244"
65
65
  }