@empiricalrun/test-gen 0.7.1 → 0.7.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @empiricalrun/test-gen
|
|
2
2
|
|
|
3
|
+
## 0.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9c66d6d: fix: empty steps in test case
|
|
8
|
+
|
|
9
|
+
## 0.7.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 9c3ee14: fix: import statements not getting detected correctly
|
|
14
|
+
- 6ec6f56: fix: flag getting picked incorrectly
|
|
15
|
+
|
|
3
16
|
## 0.7.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/bin/index.js
CHANGED
|
@@ -131,7 +131,7 @@ async function generateTest(scenarios, file, isUpdate) {
|
|
|
131
131
|
process.exit(1);
|
|
132
132
|
}
|
|
133
133
|
const scenariosPath = process.argv[2];
|
|
134
|
-
const scenario = process.argv[3];
|
|
134
|
+
const scenario = process.argv[3] === "-u" ? "" : process.argv[3];
|
|
135
135
|
const isUpdate = process.argv.includes("-u");
|
|
136
136
|
let testGenConfigs = await (0, scenarios_1.generateScenarios)(scenariosPath);
|
|
137
137
|
if (scenario) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/scenarios/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAiGpC,iBAAe,iBAAiB,CAC9B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,QAAQ,EAAE,CAAA;CAAE,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/scenarios/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAiGpC,iBAAe,iBAAiB,CAC9B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,QAAQ,EAAE,CAAA;CAAE,EAAE,CAAC,CA8BxD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -101,7 +101,14 @@ async function generateScenarios(scenariosPath) {
|
|
|
101
101
|
scenarios: [
|
|
102
102
|
{
|
|
103
103
|
name: config.name,
|
|
104
|
-
steps: config.steps
|
|
104
|
+
steps: config.steps
|
|
105
|
+
.map((s) => {
|
|
106
|
+
if (s.trim().startsWith("-")) {
|
|
107
|
+
return s.replace("-", "");
|
|
108
|
+
}
|
|
109
|
+
return s;
|
|
110
|
+
})
|
|
111
|
+
.filter((s) => !!s),
|
|
105
112
|
assert: config.assert,
|
|
106
113
|
},
|
|
107
114
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,0BAG3E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAwC7D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,0BAG3E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAwC7D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,qBAM3D;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAOhD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD"}
|
|
@@ -52,8 +52,9 @@ function validateTypescript(filePath) {
|
|
|
52
52
|
}
|
|
53
53
|
exports.validateTypescript = validateTypescript;
|
|
54
54
|
async function stripAndPrependImports(content) {
|
|
55
|
-
const
|
|
56
|
-
const
|
|
55
|
+
const importRegexp = /import\s+\{[^}]*\}\s+from\s+["'][^"']+["'];?/g;
|
|
56
|
+
const imports = content.match(importRegexp);
|
|
57
|
+
const strippedContent = content.replace(importRegexp, "");
|
|
57
58
|
const prependContent = (imports?.join("\n") || "") + "\n\n";
|
|
58
59
|
return [prependContent, strippedContent];
|
|
59
60
|
}
|