artes 1.1.19 → 1.1.20

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/executer.js CHANGED
@@ -8,6 +8,7 @@ const {
8
8
  cleanUp,
9
9
  } = require("./src/helper/executers/exporter");
10
10
  const fs = require("fs");
11
+ const path = require("path");
11
12
 
12
13
  const args = process.argv.slice(2);
13
14
 
@@ -113,9 +114,25 @@ function main() {
113
114
  runTests();
114
115
  if (flags.report) generateReport();
115
116
 
116
- if (fs.existsSync("./node_modules/artes/testsStatus/EXIT_CODE.txt")) {
117
+ if (
118
+ fs.existsSync(
119
+ path.join(
120
+ process.cwd(),
121
+ "node_modules",
122
+ "artes",
123
+ "testsStatus",
124
+ "EXIT_CODE.txt",
125
+ ),
126
+ )
127
+ ) {
117
128
  const data = fs.readFileSync(
118
- "./node_modules/artes/testsStatus/EXIT_CODE.txt",
129
+ path.join(
130
+ process.cwd(),
131
+ "node_modules",
132
+ "artes",
133
+ "testsStatus",
134
+ "EXIT_CODE.txt",
135
+ ),
119
136
  "utf8",
120
137
  );
121
138
  process.env.EXIT_CODE = parseInt(data, 10);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,12 +3,27 @@ const path = require("path");
3
3
  const fs = require("fs");
4
4
 
5
5
  function showVersion() {
6
- const artesVersion = execSync("npm root -g").toString().trim();
7
- const artesGPackageJSONPath = path.join(artesVersion, "artes/package.json");
8
- const asrtesGPackageJSON = JSON.parse(
9
- fs.readFileSync(artesGPackageJSONPath, "utf8"),
10
- );
11
- console.log(`ARTES Version: ${asrtesGPackageJSON.version}`);
6
+ try {
7
+ const localPath = path.join(
8
+ process.cwd(),
9
+ "node_modules",
10
+ "artes",
11
+ "package.json",
12
+ );
13
+ const localData = fs.readFileSync(localPath, "utf8");
14
+ const localArtes = JSON.parse(localData);
15
+ console.log(`ARTES Version: ${localArtes.version}`);
16
+ return;
17
+ } catch (err) {}
18
+
19
+ try {
20
+ const globalRoot = execSync("npm root -g").toString().trim();
21
+ const globalPath = path.join(globalRoot, "artes", "package.json");
22
+ const globalData = fs.readFileSync(globalPath, "utf8");
23
+ const globalArtes = JSON.parse(globalData);
24
+ console.log(`ARTES Version: ${globalArtes.version}`);
25
+ return;
26
+ } catch (err) {}
12
27
  }
13
28
 
14
29
  module.exports = {