testeranto 0.113.1 → 0.121.1

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.
Files changed (87) hide show
  1. package/README.md +6 -2
  2. package/bundle.js +1 -1
  3. package/dist/common/Init.js +55 -61
  4. package/dist/common/PM/base.js +233 -0
  5. package/dist/common/PM/main.js +217 -434
  6. package/dist/common/build.js +113 -92
  7. package/dist/common/defaultConfig.js +2 -2
  8. package/dist/common/esbuildConfigs/index.js +1 -1
  9. package/dist/common/esbuildConfigs/inputFilesPlugin.js +7 -3
  10. package/dist/common/esbuildConfigs/node.js +5 -3
  11. package/dist/common/esbuildConfigs/web.js +3 -3
  12. package/dist/common/init-docs.js +2 -46
  13. package/dist/common/lib/abstractBase.js +60 -54
  14. package/dist/common/lib/basebuilder.js +7 -8
  15. package/dist/common/lib/classBuilder.js +8 -5
  16. package/dist/common/lib/core.js +6 -18
  17. package/dist/common/lib/index.js +6 -1
  18. package/dist/common/run.js +10 -2
  19. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  20. package/dist/common/utils.js +9 -21
  21. package/dist/module/Init.js +55 -61
  22. package/dist/module/PM/base.js +226 -0
  23. package/dist/module/PM/main.js +218 -435
  24. package/dist/module/Project.js +117 -0
  25. package/dist/module/TestReport.js +13 -4
  26. package/dist/module/build.js +113 -92
  27. package/dist/module/defaultConfig.js +2 -2
  28. package/dist/module/esbuildConfigs/index.js +1 -1
  29. package/dist/module/esbuildConfigs/inputFilesPlugin.js +7 -3
  30. package/dist/module/esbuildConfigs/node.js +5 -3
  31. package/dist/module/esbuildConfigs/web.js +3 -3
  32. package/dist/module/init-docs.js +2 -13
  33. package/dist/module/lib/abstractBase.js +60 -54
  34. package/dist/module/lib/basebuilder.js +7 -8
  35. package/dist/module/lib/classBuilder.js +8 -5
  36. package/dist/module/lib/core.js +6 -18
  37. package/dist/module/lib/index.js +6 -1
  38. package/dist/module/run.js +10 -2
  39. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  40. package/dist/module/utils.js +8 -17
  41. package/dist/prebuild/Project.css +11367 -0
  42. package/dist/prebuild/Project.js +24640 -0
  43. package/dist/prebuild/ReportClient.js +1 -1
  44. package/dist/prebuild/TestReport.js +9 -11
  45. package/dist/prebuild/build.mjs +142 -81
  46. package/dist/prebuild/init-docs.mjs +28 -83
  47. package/dist/prebuild/run.mjs +618 -537
  48. package/dist/tsconfig.tsbuildinfo +1 -1
  49. package/dist/types/Init.d.ts +1 -1
  50. package/dist/types/PM/base.d.ts +38 -0
  51. package/dist/types/PM/main.d.ts +20 -44
  52. package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +1 -1
  53. package/dist/types/esbuildConfigs/node.d.ts +1 -1
  54. package/dist/types/esbuildConfigs/web.d.ts +1 -1
  55. package/dist/types/lib/abstractBase.d.ts +19 -11
  56. package/dist/types/lib/basebuilder.d.ts +1 -2
  57. package/dist/types/lib/index.d.ts +3 -3
  58. package/dist/types/lib/types.d.ts +2 -5
  59. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  60. package/dist/types/utils.d.ts +4 -7
  61. package/package.json +7 -6
  62. package/src/Init.ts +60 -68
  63. package/src/PM/base.ts +301 -0
  64. package/src/PM/main.ts +276 -567
  65. package/src/Project.tsx +197 -0
  66. package/src/ReportClient.tsx +1 -1
  67. package/src/TestReport.tsx +30 -15
  68. package/src/build.ts +140 -104
  69. package/src/defaultConfig.ts +2 -2
  70. package/src/esbuildConfigs/index.ts +1 -1
  71. package/src/esbuildConfigs/inputFilesPlugin.ts +7 -6
  72. package/src/esbuildConfigs/node.ts +5 -3
  73. package/src/esbuildConfigs/web.ts +4 -3
  74. package/src/init-docs.ts +2 -15
  75. package/src/lib/abstractBase.ts +113 -93
  76. package/src/lib/basebuilder.ts +8 -9
  77. package/src/lib/classBuilder.ts +11 -10
  78. package/src/lib/core.ts +15 -27
  79. package/src/lib/index.ts +13 -6
  80. package/src/lib/types.ts +3 -8
  81. package/src/run.ts +21 -5
  82. package/src/utils.ts +27 -39
  83. package/tsc.log +12 -23
  84. package/dist/common/puppeteerConfiger.js +0 -24
  85. package/dist/module/puppeteerConfiger.js +0 -19
  86. package/dist/types/puppeteerConfiger.d.ts +0 -4
  87. package/src/puppeteerConfiger.ts +0 -26
package/src/run.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import ansiC from "ansi-colors";
2
2
  import readline from "readline";
3
+ import path from "path";
3
4
 
4
5
  import { PM_Main } from "./PM/main";
5
- import { IBaseConfig, IBuiltConfig } from "./lib";
6
+ import { IBaseConfig, IBuiltConfig, IConfigV2 } from "./lib";
6
7
 
7
8
  readline.emitKeypressEvents(process.stdin);
8
9
  if (process.stdin.isTTY) process.stdin.setRawMode(true);
@@ -15,15 +16,30 @@ process.stdin.on("keypress", (str, key) => {
15
16
  }
16
17
  });
17
18
 
18
- import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
19
- const rawConfig: IBaseConfig = module.default;
19
+ let testName = process.argv[2];
20
+
21
+ const mode = process.argv[3] as "once" | "dev";
22
+ if (mode !== "once" && mode !== "dev") {
23
+ console.error("the 2nd argument should be 'dev' or 'once' ");
24
+ process.exit(-1);
25
+ }
26
+
27
+ console.log("testeranto is running", testName, mode);
28
+
29
+ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
30
+ // const testName = path.basename(process.argv[2]).split(".")[0];
31
+ const bigConfig: IConfigV2 = module.default;
32
+
33
+ const rawConfig: IBaseConfig = bigConfig.projects[testName];
34
+
35
+ // const rawConfig: IBaseConfig = module.default;
20
36
 
21
37
  const config: IBuiltConfig = {
22
38
  ...rawConfig,
23
- buildDir: process.cwd() + "/" + rawConfig.outdir,
39
+ buildDir: process.cwd() + "/" + `testeranto/${testName}.json`,
24
40
  };
25
41
 
26
- const pm = new PM_Main(config);
42
+ const pm = new PM_Main(config, testName, mode);
27
43
  pm.start();
28
44
 
29
45
  process.stdin.on("keypress", (str, key) => {
package/src/utils.ts CHANGED
@@ -24,74 +24,62 @@ export const destinationOfRuntime = (
24
24
  .join(".");
25
25
  };
26
26
 
27
- export const tscPather = (entryPoint: string, platform: "web" | "node") => {
27
+ export const tscPather = (
28
+ entryPoint: string,
29
+ platform: "web" | "node",
30
+ projectName: string
31
+ ) => {
28
32
  return path.join(
29
- "./docs/",
30
- platform,
33
+ "testeranto",
34
+ "reports",
35
+ projectName,
31
36
  entryPoint.split(".").slice(0, -1).join("."),
37
+ platform,
32
38
  `type_errors.txt`
33
39
  );
34
40
  };
35
41
 
36
- export const tscExitCodePather = (
42
+ export const lintPather = (
37
43
  entryPoint: string,
38
- platform: "web" | "node"
44
+ platform: "web" | "node",
45
+ projectName: string
39
46
  ) => {
40
47
  return path.join(
41
- "./docs/",
42
- platform,
48
+ "testeranto",
49
+ "reports",
50
+ projectName,
43
51
  entryPoint.split(".").slice(0, -1).join("."),
44
- `type_errors.txt`
45
- );
46
- };
47
-
48
- export const lintPather = (entryPoint: string, platform: "web" | "node") => {
49
- return path.join(
50
- "./docs/",
51
52
  platform,
52
- entryPoint.split(".").slice(0, -1).join("."),
53
53
  `lint_errors.json`
54
54
  );
55
55
  };
56
56
 
57
- export const lintExitCodePather = (
57
+ export const bddPather = (
58
58
  entryPoint: string,
59
- platform: "web" | "node"
59
+ platform: "web" | "node",
60
+ projectName: string
60
61
  ) => {
61
62
  return path.join(
62
- "./docs/",
63
- platform,
63
+ "testeranto",
64
+ "reports",
65
+ projectName,
64
66
  entryPoint.split(".").slice(0, -1).join("."),
65
- `lint_errors.txt`
66
- );
67
- };
68
-
69
- export const bddPather = (entryPoint: string, platform: "web" | "node") => {
70
- return path.join(
71
- "./docs/",
72
67
  platform,
73
- entryPoint.split(".").slice(0, -1).join("."),
74
68
  `tests.json`
75
69
  );
76
70
  };
77
71
 
78
- export const bddExitCodePather = (
72
+ export const promptPather = (
79
73
  entryPoint: string,
80
- platform: "web" | "node"
74
+ platform: "web" | "node",
75
+ projectName: string
81
76
  ) => {
82
77
  return path.join(
83
- "./docs/",
84
- platform,
78
+ "testeranto",
79
+ "reports",
80
+ projectName,
85
81
  entryPoint.split(".").slice(0, -1).join("."),
86
- `bdd_errors.txt`
87
- );
88
- };
89
-
90
- export const promptPather = (entryPoint: string, platform: "web" | "node") => {
91
- return path.join(
92
- "./docs/",
93
82
  platform,
94
- entryPoint.split(".").slice(0, -1).join("."),
95
83
  `prompt.txt`
96
84
  );
97
85
  };
package/tsc.log CHANGED
@@ -1,37 +1,25 @@
1
1
  $ /Users/adam/Code/testeranto/node_modules/.bin/tsc --noEmit
2
- src/esbuildConfigs/node.ts(62,7): error TS2741: Property 'setup' is missing in type 'Plugin' but required in type 'import("/Users/adam/Code/testeranto/node_modules/esbuild/lib/main").Plugin'.
3
- src/esbuildConfigs/web.ts(73,7): error TS2741: Property 'setup' is missing in type 'Plugin' but required in type 'import("/Users/adam/Code/testeranto/node_modules/esbuild/lib/main").Plugin'.
4
- src/lib/abstractBase.ts(5,27): error TS2307: Cannot find module '../../dist/types/src/Types.js' or its corresponding type declarations.
5
- src/lib/abstractBase.ts(158,11): error TS2345: Argument of type '(t: I["then"]) => unknown' is not assignable to parameter of type '(t: Awaited<I["then"]> | undefined) => boolean'.
2
+ src/defaultConfig.ts(9,3): error TS2353: Object literal may only specify known properties, and 'devMode' does not exist in type 'IBaseConfig'.
3
+ src/esbuildConfigs/node.ts(64,7): error TS2741: Property 'setup' is missing in type 'Plugin' but required in type 'import("/Users/adam/Code/testeranto/node_modules/esbuild/lib/main").Plugin'.
4
+ src/esbuildConfigs/web.ts(74,7): error TS2741: Property 'setup' is missing in type 'Plugin' but required in type 'import("/Users/adam/Code/testeranto/node_modules/esbuild/lib/main").Plugin'.
5
+ src/lib/abstractBase.ts(157,11): error TS2345: Argument of type '(t: I["then"]) => unknown' is not assignable to parameter of type '(t: Awaited<I["then"]> | undefined) => boolean'.
6
6
  Type 'unknown' is not assignable to type 'boolean'.
7
- src/lib/abstractBase.ts(703,68): error TS2554: Expected 5 arguments, but got 4.
8
- src/lib/index.ts(1,27): error TS2307: Cannot find module '../../dist/types/src/Types.js' or its corresponding type declarations.
9
- src/lib/index.ts(43,8): error TS18046: 'thenCb' is of type 'unknown'.
10
- src/lib/index.ts(44,19): error TS2322: Type 'unknown' is not assignable to type 'Promise<unknown>'.
7
+ src/lib/core.ts(213,62): error TS2554: Expected 5 arguments, but got 6.
8
+ src/lib/index.ts(47,19): error TS2322: Type 'unknown' is not assignable to type 'Promise<unknown>'.
11
9
  src/Node.ts(58,56): error TS2345: Argument of type 'PM_Node' is not assignable to parameter of type 'PM'.
12
10
  Types of property 'customScreenShot' are incompatible.
13
11
  Type '(opts: ScreencastOptions, cdpPage: CdpPage) => any' is not assignable to type '(opts: object, page?: string | undefined) => any'.
14
12
  Types of parameters 'cdpPage' and 'page' are incompatible.
15
13
  Type 'string | undefined' is not assignable to type 'CdpPage'.
16
14
  Type 'undefined' is not assignable to type 'CdpPage'.
17
- src/PM/main.ts(272,24): error TS18048: 'page' is possibly 'undefined'.
18
- src/PM/main.ts(303,9): error TS2322: Type 'string' is not assignable to type '`${string}.webm`'.
19
- src/PM/main.ts(306,17): error TS2538: Type 'undefined' cannot be used as an index type.
20
- src/PM/main.ts(341,3): error TS2416: Property 'customScreenShot' in type 'PM_Main' is not assignable to the same property in base type 'PM'.
21
- Type '(opts: object, cdpPage?: CdpPage | undefined) => void' is not assignable to type '(opts: object, page?: string | undefined) => any'.
22
- Types of parameters 'cdpPage' and 'page' are incompatible.
23
- Type 'string | undefined' is not assignable to type 'CdpPage | undefined'.
24
- Type 'string' is not assignable to type 'CdpPage'.
25
- src/PM/main.ts(772,24): error TS2339: Property 'status' does not exist on type '{ runTimeError?: number | "?" | undefined; typeErrors?: number | "?" | undefined; staticErrors?: number | "?" | undefined; prompt?: string | undefined; }'.
26
- src/PM/main.ts(776,24): error TS2339: Property 'status' does not exist on type '{ runTimeError?: number | "?" | undefined; typeErrors?: number | "?" | undefined; staticErrors?: number | "?" | undefined; prompt?: string | undefined; }'.
27
- src/PM/main.ts(1035,15): error TS2345: Argument of type 'Page' is not assignable to parameter of type 'Page | PromiseLike<Page>'.
28
- Type 'import("/Users/adam/Code/testeranto/node_modules/puppeteer-core/lib/types").Page' is not assignable to type 'import("/Users/adam/Code/testeranto/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page").Page'.
29
- Property '#private' in type 'Page' refers to a different member that cannot be accessed from within type 'Page'.
30
15
  src/PM/node.ts(88,3): error TS2416: Property 'customScreenShot' in type 'PM_Node' is not assignable to the same property in base type 'PM'.
31
16
  Type '(opts: ScreencastOptions, cdpPage: CdpPage) => any' is not assignable to type '(opts: object, page?: string | undefined) => any'.
32
17
  Types of parameters 'cdpPage' and 'page' are incompatible.
33
18
  Type 'string | undefined' is not assignable to type 'CdpPage'.
34
19
  Type 'undefined' is not assignable to type 'CdpPage'.
20
+ src/Project.tsx(37,31): error TS2531: Object is possibly 'null'.
21
+ src/Project.tsx(193,38): error TS2345: Argument of type 'FunctionComponentElement<{}>' is not assignable to parameter of type 'ReactNode'.
22
+ Property 'children' is missing in type 'FunctionComponentElement<{}>' but required in type 'ReactPortal'.
35
23
  src/ReportClient.tsx(161,38): error TS2345: Argument of type 'FunctionComponentElement<{}>' is not assignable to parameter of type 'ReactNode'.
36
24
  Property 'children' is missing in type 'FunctionComponentElement<{}>' but required in type 'ReactPortal'.
37
25
  src/SubPackages/react-dom/component/web.ts(90,13): error TS2345: Argument of type 'CElement<any, TesterantoComponent>' is not assignable to parameter of type 'ReactNode'.
@@ -102,7 +90,8 @@ src/SubPackages/react/component/node.ts(84,14): error TS2349: This expression is
102
90
  Type 'unknown' has no call signatures.
103
91
  src/SubPackages/react/component/web.ts(83,14): error TS2349: This expression is not callable.
104
92
  Type 'unknown' has no call signatures.
105
- src/TestReport.tsx(155,56): error TS2739: Type '{ key: string; name: string; whens: { name: string; error: string; }[]; thens: { name: string; error: string; }[]; }' is missing the following properties from type '{ key: string; name: string; error: string[]; features: string[]; whens: { name: string; error: string; }[]; thens: { name: string; error: string; }[]; }': error, features
106
- src/TestReport.tsx(172,38): error TS2345: Argument of type 'FunctionComponentElement<{}>' is not assignable to parameter of type 'ReactNode'.
93
+ src/TestReport.tsx(25,28): error TS2339: Property 'log' does not exist on type '{ given: { key: string; name: string; error: string[]; features: string[]; whens: { name: string; error: string; }[]; thens: { name: string; error: string; }[]; }; }'.
94
+ src/TestReport.tsx(170,56): error TS2739: Type '{ key: string; name: string; whens: { name: string; error: string; }[]; thens: { name: string; error: string; }[]; }' is missing the following properties from type '{ key: string; name: string; error: string[]; features: string[]; whens: { name: string; error: string; }[]; thens: { name: string; error: string; }[]; }': error, features
95
+ src/TestReport.tsx(187,38): error TS2345: Argument of type 'FunctionComponentElement<{}>' is not assignable to parameter of type 'ReactNode'.
107
96
  Property 'children' is missing in type 'FunctionComponentElement<{}>' but required in type 'ReactPortal'.
108
97
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const http_1 = __importDefault(require("http"));
7
- exports.default = async (port) => new Promise((resolve, reject) => {
8
- let json = "";
9
- const request = http_1.default.request({
10
- host: "127.0.0.1",
11
- path: "/json/version",
12
- port,
13
- }, (response) => {
14
- response.on("error", reject);
15
- response.on("data", (chunk) => {
16
- json += chunk.toString();
17
- });
18
- response.on("end", () => {
19
- resolve(JSON.parse(json));
20
- });
21
- });
22
- request.on("error", reject);
23
- request.end();
24
- });
@@ -1,19 +0,0 @@
1
- import http from "http";
2
- export default async (port) => new Promise((resolve, reject) => {
3
- let json = "";
4
- const request = http.request({
5
- host: "127.0.0.1",
6
- path: "/json/version",
7
- port,
8
- }, (response) => {
9
- response.on("error", reject);
10
- response.on("data", (chunk) => {
11
- json += chunk.toString();
12
- });
13
- response.on("end", () => {
14
- resolve(JSON.parse(json));
15
- });
16
- });
17
- request.on("error", reject);
18
- request.end();
19
- });
@@ -1,4 +0,0 @@
1
- declare const _default: (port: string) => Promise<{
2
- webSocketDebuggerUrl: string;
3
- }>;
4
- export default _default;
@@ -1,26 +0,0 @@
1
- import http from "http";
2
-
3
- export default async (
4
- port: string
5
- ): Promise<{ webSocketDebuggerUrl: string }> =>
6
- new Promise((resolve, reject) => {
7
- let json = "";
8
- const request = http.request(
9
- {
10
- host: "127.0.0.1",
11
- path: "/json/version",
12
- port,
13
- },
14
- (response) => {
15
- response.on("error", reject);
16
- response.on("data", (chunk: Buffer) => {
17
- json += chunk.toString();
18
- });
19
- response.on("end", () => {
20
- resolve(JSON.parse(json));
21
- });
22
- }
23
- );
24
- request.on("error", reject);
25
- request.end();
26
- });