muagqa 1.7.5 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muagqa",
3
- "version": "1.7.5",
3
+ "version": "1.8.0",
4
4
  "description": "MuagQA CLI — Test case runner with one-time session token and Playwright recorder",
5
5
  "author": "Mary C.N. Enwezor",
6
6
  "license": "MIT",
@@ -1,12 +1,12 @@
1
1
  import fetch from "node-fetch";
2
2
  import fs from "fs";
3
+ import path from "path";
3
4
 
4
5
  export async function generateTemplateFromDashboard({ token, options }) {
5
6
  console.log("Fetching template test cases...");
6
7
 
7
8
  const endpoint =
8
9
  process.env.MUAGQA_TEMPLATE_URL || "https://muagqa.vercel.app/api/template/generate";
9
- console.log(`Template endpoint: ${endpoint}`);
10
10
 
11
11
  const response = await fetch(endpoint, {
12
12
  method: "POST",
@@ -33,11 +33,11 @@ export async function generateTemplateFromDashboard({ token, options }) {
33
33
  }
34
34
 
35
35
  const output = data.testCode;
36
- fs.writeFileSync("generated-template.spec.js", output);
36
+ const outputDir = path.join(process.cwd(), "generated-tests", "templates");
37
+ fs.mkdirSync(outputDir, { recursive: true });
38
+ const filePath = path.join(outputDir, "generated-template.spec.js");
39
+ fs.writeFileSync(filePath, output);
37
40
 
38
- console.log("Smart test template generated:");
39
- console.log("==============================");
40
- console.log(output);
41
- console.log("==============================");
42
- console.log("File saved as: generated-template.spec.js");
41
+ console.log("Template test file generated.");
42
+ console.log(`File saved as: ${filePath}`);
43
43
  }