comparadise-utils 0.0.2 → 0.0.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.
@@ -37,7 +37,7 @@ function matchScreenshot(subject, args) {
37
37
  const testPath = Cypress.spec.relative;
38
38
  const lastSlashIndex = testPath.lastIndexOf('/');
39
39
  const testPathWithoutFileName = testPath.substring(0, lastSlashIndex);
40
- const screenshotPath = `${testPathWithoutFileName}/${rawName}`;
40
+ const screenshotPath = `${screenshotsFolder}/${testPathWithoutFileName}/${rawName}`;
41
41
  cy.task('baseExists', screenshotPath).then(hasBase => {
42
42
  if (typeof hasBase !== 'boolean')
43
43
  throw new Error('Result of baseExists task was not a boolean.');
@@ -25,12 +25,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.compareScreenshots = exports.baseExists = void 0;
27
27
  const fs = __importStar(require("fs"));
28
- const path_1 = require("path");
28
+ const path_1 = __importStar(require("path"));
29
29
  const pngjs_1 = require("pngjs");
30
30
  const images_1 = require("./images");
31
31
  function baseExists(screenshotFolder) {
32
32
  const fileName = (0, path_1.join)(screenshotFolder, 'base.png');
33
- const exists = fs.existsSync(fileName);
33
+ const exists = fs.existsSync(path_1.default.resolve(fileName));
34
34
  if (!exists) {
35
35
  console.log('Base image does not exist. This means a new one will be created. If your base should exist, something went wrong.');
36
36
  }
package/package.json CHANGED
@@ -29,5 +29,5 @@
29
29
  "build": "tsc",
30
30
  "postbuild": "echo \"require('./dist/match-screenshot');\" > commands.js"
31
31
  },
32
- "version": "0.0.2"
32
+ "version": "0.0.3"
33
33
  }