@empiricalrun/test-gen 0.6.0 → 0.7.0

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,11 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f4a2519: feat: add support for json string support for adding / updating tests using test-gen
8
+
3
9
  ## 0.6.0
4
10
 
5
11
  ### Minor Changes
@@ -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,CAqBxD;AAED,OAAO,EAAE,iBAAiB,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,CAuBxD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -88,8 +88,12 @@ async function generateScenarios(scenariosPath) {
88
88
  if (scenariosPath.startsWith("https://docs.google.com/spreadsheets")) {
89
89
  return await generateScenariosUsingGsheet(scenariosPath);
90
90
  }
91
- else if (isValidJSON(scenariosPath)) {
92
- const config = JSON.parse(scenariosPath);
91
+ else if (scenariosPath.endsWith(".yaml")) {
92
+ return await generateScenariosUsingYAML(scenariosPath);
93
+ }
94
+ else if (isValidJSON(atob(scenariosPath))) {
95
+ const str = atob(scenariosPath);
96
+ const config = JSON.parse(str);
93
97
  const specPath = `./tests/${config.group || "index"}.spec.ts`;
94
98
  return [
95
99
  {
@@ -104,8 +108,6 @@ async function generateScenarios(scenariosPath) {
104
108
  },
105
109
  ];
106
110
  }
107
- else {
108
- return await generateScenariosUsingYAML(scenariosPath);
109
- }
111
+ throw Error("Invalid path for test scenarios");
110
112
  }
111
113
  exports.generateScenarios = generateScenarios;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"