regressify 1.2.2 → 1.2.4

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.
@@ -173,14 +173,14 @@ module.exports = async (context) => {
173
173
  }
174
174
  }
175
175
 
176
- if (action.persit) {
177
- console.log(logPrefix + 'persit:', action.uncheck);
176
+ if (!!action.persit) {
177
+ console.log(logPrefix + 'persit:', action.persit);
178
178
  const states = await browserContext.storageState();
179
- fs.writeFileSync(getStatePath(), JSON.stringify(states, null, 2));
179
+ fs.writeFileSync(getStatePath(action.persit), JSON.stringify(states, null, 2));
180
180
  }
181
181
  }
182
182
  };
183
183
 
184
184
  function getStatePath(stateName) {
185
- return process.cwd() + `/states/storage-states--${stateName}.json`;
185
+ return path.join(process.cwd(), 'states', `storage-states--${stateName}.json`);
186
186
  }
@@ -1,9 +1,10 @@
1
+ const path = require('path');
1
2
  const autoScroll = require('../auto-scroll');
2
3
  const scrollTop = require('../scroll-top');
3
4
  const chalkImport = import('chalk').then((m) => m.default);
4
5
 
5
6
  function getStatePath(stateName) {
6
- return process.cwd() + `/states/storage-states--${stateName}.json`;
7
+ return path.join(process.cwd(), 'states', `storage-states--${stateName}.json`);
7
8
  }
8
9
 
9
10
  module.exports = async (page, scenario, viewport, isReference, browserContext) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "regressify",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Visual regression tests support",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",