@empiricalrun/test-gen 0.7.1 → 0.7.2

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,12 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9c3ee14: fix: import statements not getting detected correctly
8
+ - 6ec6f56: fix: flag getting picked incorrectly
9
+
3
10
  ## 0.7.1
4
11
 
5
12
  ### 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/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,qBAK3D;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAOhD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD"}
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 imports = content.match(/import.* from.*;/g);
56
- const strippedContent = content.replace(/import.* from.*;/g, "");
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"