regressify 1.0.7 → 1.0.9
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/README.md +5 -5
- package/cli.js +2 -2
- package/package.json +1 -1
- package/update-package.js +4 -6
package/README.md
CHANGED
|
@@ -7,21 +7,21 @@ Please check [Documentation](https://tuyen.blog/optimizely-cms/testing/get-start
|
|
|
7
7
|
1. Install:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm i regressify
|
|
10
|
+
npm i -g regressify
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
1. Manual Set up all test and config files in the **visual_tests** folder and place it at the root of the project, or automatically add it using the command:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx regressify
|
|
16
|
+
npx regressify init
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
1. Add to scripts in package.json:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
"ref": "regressify
|
|
23
|
-
"approve": "regressify
|
|
24
|
-
"test": "regressify
|
|
22
|
+
"ref": "regressify ref",
|
|
23
|
+
"approve": "regressify approve",
|
|
24
|
+
"test": "regressify test"
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
1. Use new command aliases:
|
package/cli.js
CHANGED
|
@@ -55,7 +55,7 @@ if (command === 'init') {
|
|
|
55
55
|
|
|
56
56
|
const postInstallPath = pathToFileURL(path.join(__dirname, 'generate_tests.js'));
|
|
57
57
|
if (fs.existsSync(postInstallPath)) {
|
|
58
|
-
console.log(chalk.yellow('
|
|
58
|
+
console.log(chalk.yellow('Generate folder visual_tests ...'));
|
|
59
59
|
await import(postInstallPath);
|
|
60
60
|
} else {
|
|
61
61
|
console.log(chalk.red('generate_tests.js not found!'));
|
|
@@ -63,7 +63,7 @@ if (command === 'init') {
|
|
|
63
63
|
|
|
64
64
|
const updatePackageJsonPath = pathToFileURL(path.join(__dirname, 'update-package.js'));
|
|
65
65
|
if (fs.existsSync(updatePackageJsonPath)) {
|
|
66
|
-
console.log(chalk.yellow('
|
|
66
|
+
console.log(chalk.yellow('Update package.json ...'));
|
|
67
67
|
await import(updatePackageJsonPath);
|
|
68
68
|
} else {
|
|
69
69
|
console.log(chalk.red('update-package.js not found!'));
|
package/package.json
CHANGED
package/update-package.js
CHANGED
|
@@ -12,12 +12,10 @@ async function updatePackageJson() {
|
|
|
12
12
|
const packageJsonText = fs.readFileSync(packageJsonPath, 'utf8');
|
|
13
13
|
const packageJson = JSON.parse(packageJsonText);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
scripts.ref = 'regressify
|
|
17
|
-
scripts.approve = 'regressify
|
|
18
|
-
scripts.test = 'regressify
|
|
19
|
-
|
|
20
|
-
packageJson.scripts = scripts;
|
|
15
|
+
packageJson.scripts = packageJson.scripts || {};
|
|
16
|
+
packageJson.scripts.ref = 'regressify ref';
|
|
17
|
+
packageJson.scripts.approve = 'regressify approve';
|
|
18
|
+
packageJson.scripts.test = 'regressify test';
|
|
21
19
|
|
|
22
20
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
23
21
|
}
|