testeranto 0.79.36 → 0.79.37

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.
@@ -51,9 +51,9 @@ const onDone = () => {
51
51
  }
52
52
  };
53
53
  export class ITProject {
54
- constructor(config) {
54
+ constructor(configs) {
55
55
  this.mode = `up`;
56
- this.config = config;
56
+ const config = Object.assign(Object.assign({}, configs), { buildDir: process.cwd() + "/" + configs.outdir });
57
57
  fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
58
58
  Promise.resolve(Promise.all([...this.getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
59
59
  const sourceFileSplit = sourceFilePath.split("/");
@@ -15,12 +15,10 @@ process.stdin.on("keypress", (str, key) => {
15
15
  process.exit();
16
16
  }
17
17
  });
18
- export default async (configs) => {
19
- fs.writeFileSync(`${configs.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, configs), { buildDir: process.cwd() + "/" + configs.outdir }), null, 2));
20
- // const configs = jsonc.parse(
21
- // (await fs.readFileSync("./docs/testeranto.json")).toString()
22
- // ) as IBuiltConfig;
23
- const pm = new PM_Main(configs);
18
+ export default async (partialConfig) => {
19
+ const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
20
+ fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
21
+ const pm = new PM_Main(config);
24
22
  await pm.startPuppeteer({
25
23
  waitForInitialPage: false,
26
24
  executablePath: "/opt/homebrew/bin/chromium",
@@ -57,23 +55,23 @@ export default async (configs) => {
57
55
  // "--start-maximized",
58
56
  ],
59
57
  }, ".");
60
- configs.tests.forEach(([test, runtime, tr, sidecars]) => {
58
+ config.tests.forEach(([test, runtime, tr, sidecars]) => {
61
59
  if (runtime === "node") {
62
- pm.launchNode(test, destinationOfRuntime(test, "node", configs));
60
+ pm.launchNode(test, destinationOfRuntime(test, "node", config));
63
61
  }
64
62
  else if (runtime === "web") {
65
- pm.launchWeb(test, destinationOfRuntime(test, "web", configs), sidecars);
63
+ pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
66
64
  }
67
65
  else {
68
66
  console.error("runtime makes no sense", runtime);
69
67
  }
70
68
  });
71
- console.log("ready and watching for changes...", configs.buildDir);
72
- fs.watch(configs.buildDir, {
69
+ console.log("ready and watching for changes...", config.buildDir);
70
+ fs.watch(config.buildDir, {
73
71
  recursive: true,
74
72
  }, (eventType, changedFile) => {
75
73
  if (changedFile) {
76
- configs.tests.forEach(([test, runtime, tr, sidecars]) => {
74
+ config.tests.forEach(([test, runtime, tr, sidecars]) => {
77
75
  if (eventType === "change" || eventType === "rename") {
78
76
  if (changedFile ===
79
77
  test
@@ -82,7 +80,7 @@ export default async (configs) => {
82
80
  .slice(0, -1)
83
81
  .concat("mjs")
84
82
  .join(".")) {
85
- pm.launchNode(test, destinationOfRuntime(test, "node", configs));
83
+ pm.launchNode(test, destinationOfRuntime(test, "node", config));
86
84
  }
87
85
  if (changedFile ===
88
86
  test
@@ -91,7 +89,7 @@ export default async (configs) => {
91
89
  .slice(0, -1)
92
90
  .concat("mjs")
93
91
  .join(".")) {
94
- pm.launchWeb(test, destinationOfRuntime(test, "web", configs), sidecars);
92
+ pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
95
93
  }
96
94
  }
97
95
  });
@@ -54,8 +54,9 @@ function listToTree(fileList) {
54
54
  }
55
55
  return root.children;
56
56
  }
57
- export default (config) => {
58
- fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
57
+ export default (partialConfig) => {
58
+ const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
59
+ fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(config, null, 2));
59
60
  const app = express();
60
61
  new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
61
62
  .connect()
@@ -92,10 +93,10 @@ export default (config) => {
92
93
  // `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
93
94
  // );
94
95
  // });
95
- app.get("/testeranto.json", (req, res) => {
96
- res.sendFile(`${process.cwd()}/docs/testeranto.json`);
97
- // res.json(config);
98
- });
96
+ // app.get("/testeranto.json", (req, res) => {
97
+ // // res.sendFile(`${process.cwd()}/docs/testeranto.json`);
98
+ // res.json(config);
99
+ // });
99
100
  app.get("/", (req, res) => {
100
101
  res.send(`<!DOCTYPE html>
101
102
  <html lang="en">
@@ -150,7 +151,7 @@ export default (config) => {
150
151
  .toArray());
151
152
  });
152
153
  });
153
- app.use("/docs", express.static(path.join(process.cwd(), "docs")));
154
+ app.use("/", express.static(path.join(process.cwd())));
154
155
  app.get("/docGal/fs.json", (req, res) => {
155
156
  const directoryPath = "./"; // Replace with the desired directory path
156
157
  // const textFiles = findTextFiles(directoryPath);