testeranto 0.134.0 → 0.135.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.
Files changed (71) hide show
  1. package/.aider.chat.history.md +601 -0
  2. package/.aider.input.history +36 -0
  3. package/.aider.tags.cache.v3/{18/8b/7dfca822129dad10b5cacadf7728.val → 8e/ec/2d4659a1589a0187a757ab1cbefa.val} +0 -0
  4. package/.aider.tags.cache.v3/cache.db +0 -0
  5. package/.aider.tags.cache.v3/{8d/fa/12860238755bcfab9af8a93c52ab.val → d8/b0/a8966fcd65890fd9f70d7afe8141.val} +0 -0
  6. package/README.md +60 -347
  7. package/dist/common/src/CoreTypes.js +2 -0
  8. package/dist/common/src/PM/PM_WithEslintAndTsc.js +10 -8
  9. package/dist/common/src/PM/main.js +12 -7
  10. package/dist/common/src/PM/node.js +10 -3
  11. package/dist/common/src/build.js +3 -2
  12. package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
  13. package/dist/common/src/esbuildConfigs/node.js +2 -16
  14. package/dist/common/src/esbuildConfigs/pure.js +2 -16
  15. package/dist/common/src/esbuildConfigs/rebuildPlugin.js +22 -0
  16. package/dist/common/src/esbuildConfigs/web.js +2 -16
  17. package/dist/common/src/lib/abstractBase.js +6 -1
  18. package/dist/common/src/lib/classBuilder.js +2 -3
  19. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  20. package/dist/module/src/CoreTypes.js +1 -0
  21. package/dist/module/src/PM/PM_WithEslintAndTsc.js +10 -8
  22. package/dist/module/src/PM/main.js +12 -7
  23. package/dist/module/src/PM/node.js +10 -3
  24. package/dist/module/src/build.js +3 -2
  25. package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
  26. package/dist/module/src/esbuildConfigs/node.js +2 -16
  27. package/dist/module/src/esbuildConfigs/pure.js +2 -16
  28. package/dist/module/src/esbuildConfigs/rebuildPlugin.js +17 -0
  29. package/dist/module/src/esbuildConfigs/web.js +2 -16
  30. package/dist/module/src/lib/abstractBase.js +6 -1
  31. package/dist/module/src/lib/classBuilder.js +2 -3
  32. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  33. package/dist/prebuild/Project.js +15 -16
  34. package/dist/prebuild/TestReport.js +12 -14
  35. package/dist/prebuild/build.mjs +39 -61
  36. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +14 -1
  37. package/dist/prebuild/run.mjs +50 -31
  38. package/dist/types/src/CoreTypes.d.ts +51 -0
  39. package/dist/types/src/Node.d.ts +2 -2
  40. package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +1 -19
  41. package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +1 -19
  42. package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +1 -19
  43. package/dist/types/src/PM/index.d.ts +1 -1
  44. package/dist/types/src/Types.d.ts +13 -57
  45. package/dist/types/src/Web.d.ts +1 -1
  46. package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +6 -0
  47. package/dist/types/src/lib/abstractBase.d.ts +2 -8
  48. package/dist/types/src/lib/core.d.ts +1 -1
  49. package/dist/types/src/mothership/test.d.ts +1 -20
  50. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  51. package/docs/index.md +277 -0
  52. package/package.json +6 -1
  53. package/src/CoreTypes.ts +171 -0
  54. package/src/Node.ts +25 -11
  55. package/src/PM/PM_WithEslintAndTsc.ts +46 -15
  56. package/src/PM/index.ts +1 -1
  57. package/src/PM/main.ts +17 -16
  58. package/src/PM/node.ts +10 -10
  59. package/src/Types.ts +166 -150
  60. package/src/Web.ts +0 -3
  61. package/src/build.ts +3 -2
  62. package/src/esbuildConfigs/eslint-formatter-testeranto.ts +17 -1
  63. package/src/esbuildConfigs/node.ts +2 -18
  64. package/src/esbuildConfigs/pure.ts +2 -18
  65. package/src/esbuildConfigs/rebuildPlugin.ts +23 -0
  66. package/src/esbuildConfigs/web.ts +2 -18
  67. package/src/lib/abstractBase.ts +6 -1
  68. package/src/lib/classBuilder.ts +5 -4
  69. package/src/lib/core.ts +5 -9
  70. package/.aider.tags.cache.v3/cache.db-shm +0 -0
  71. package/.aider.tags.cache.v3/cache.db-wal +0 -0
@@ -1,20 +1,2 @@
1
- import { PM_Pure_Sidecar } from "../pureSidecar";
2
- import { Ibdd_out, Ibdd_in } from "../../Types";
3
- type I = Ibdd_in<PM_Pure_Sidecar, PM_Pure_Sidecar, unknown, unknown, unknown, unknown, unknown>;
4
- type O = Ibdd_out<{
5
- SidecarInitialized: [null];
6
- }, {
7
- SidecarReady: [];
8
- }, {
9
- SendTestMessage: [string];
10
- VerifyCleanup: [];
11
- }, {
12
- MessageReceived: [string];
13
- ListenersCleaned: [];
14
- }, {
15
- SidecarState: unknown;
16
- }>;
17
- declare const _default: Promise<import("../../lib/core").default<IT, O, {
18
- whens: import("../../Types").TestWhenImplementation<I, O>;
19
- }>>;
1
+ declare const _default: Promise<import("../../lib/core").default<IT, OT, any>>;
20
2
  export default _default;
@@ -1,20 +1,2 @@
1
- import { PM_Web_Sidecar } from "../webSidecar";
2
- import { Ibdd_out, Ibdd_in } from "../../Types";
3
- type I = Ibdd_in<PM_Web_Sidecar, PM_Web_Sidecar, unknown, unknown, unknown, unknown, unknown>;
4
- type O = Ibdd_out<{
5
- SidecarInitialized: [null];
6
- }, {
7
- SidecarReady: [];
8
- }, {
9
- SendTestMessage: [string];
10
- VerifyCleanup: [];
11
- }, {
12
- MessageReceived: [string];
13
- ListenersCleaned: [];
14
- }, {
15
- SidecarState: unknown;
16
- }>;
17
- declare const _default: Promise<import("../../lib/core").default<IT, O, {
18
- whens: import("../../Types").TestWhenImplementation<I, O>;
19
- }>>;
1
+ declare const _default: Promise<import("../../lib/core").default<IT, OT, any>>;
20
2
  export default _default;
@@ -29,7 +29,7 @@ export declare abstract class PM {
29
29
  abstract typeInto(selector: string, value: string): any;
30
30
  abstract waitForSelector(p: any, sel: string): any;
31
31
  abstract write(uid: number, contents: string): Promise<boolean>;
32
- abstract writeFileSync(f: string, c: string, t: string): Promise<boolean>;
32
+ abstract writeFileSync(f: string, c: string): Promise<boolean>;
33
33
  abstract launchSideCar(n: number): Promise<[number, ITTestResourceConfiguration]>;
34
34
  abstract stopSideCar(n: number): Promise<any>;
35
35
  }
@@ -1,9 +1,11 @@
1
1
  import { Plugin } from "esbuild";
2
2
  import { ITTestResourceConfiguration } from "./lib/index.js";
3
3
  import { PM } from "./PM/index.js";
4
- import { IT, OT } from "../dist/types/src/Types.js";
5
- import { IGivens, BaseCheck, BaseSuite, BaseWhen, BaseThen, BaseGiven } from "./lib/abstractBase.js";
6
- import { ITestCheckCallback } from "./lib/types.js";
4
+ import { BaseWhen, BaseThen, BaseGiven, BaseCheck, BaseSuite, IGivens } from "./lib/abstractBase.js";
5
+ import { Ibdd_in, Ibdd_out } from "./CoreTypes.js";
6
+ export type SuiteSpecification<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
7
+ [K in keyof O["suites"]]: (name: string, givens: IGivens<I>, checks: BaseCheck<I>[]) => BaseSuite<I, O>;
8
+ };
7
9
  export type TestSummary = {
8
10
  testName: string;
9
11
  errors?: {
@@ -49,82 +51,36 @@ export type ProjectConfig = {
49
51
  minify?: boolean;
50
52
  debug?: boolean;
51
53
  };
52
- export type SuiteSpecification<I extends IT, O extends OT> = {
53
- [K in keyof O["suites"]]: (name: string, givens: IGivens<I>, checks: BaseCheck<I>[]) => BaseSuite<I, O>;
54
- };
55
- export type GivenSpecification<I extends IT, O extends OT> = {
54
+ export type GivenSpecification<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
56
55
  [K in keyof O["givens"]]: (features: string[], whens: BaseWhen<I>[], thens: BaseThen<I>[], ...xtrasB: O["givens"][K]) => BaseGiven<I>;
57
56
  };
58
- export type WhenSpecification<I extends IT, O extends OT> = {
57
+ export type WhenSpecification<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
59
58
  [K in keyof O["whens"]]: (...xtrasC: O["whens"][K]) => BaseWhen<I>;
60
59
  };
61
- export type ThenSpecification<I extends IT, O extends OT> = {
60
+ export type ThenSpecification<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
62
61
  [K in keyof O["thens"]]: (...xtrasD: O["thens"][K]) => BaseThen<I>;
63
62
  };
64
- export type ITestSpecification<I extends IT, O extends OT> = (Suite: SuiteSpecification<I, O>, Given: GivenSpecification<I, O>, When: WhenSpecification<I, O>, Then: ThenSpecification<I, O>, Check: ITestCheckCallback<I, O>) => any[];
65
- export type TestSuiteImplementation<O extends OT> = {
63
+ export type TestSuiteImplementation<O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
66
64
  [K in keyof O["suites"]]: string;
67
65
  };
68
- export type TestGivenImplementation<I extends IT, O extends OT> = {
66
+ export type TestGivenImplementation<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
69
67
  [K in keyof O["givens"]]: (...Ig: O["givens"][K]) => I["given"];
70
68
  };
71
- export type TestWhenImplementation<I extends IT, O extends OT> = {
69
+ export type TestWhenImplementation<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
72
70
  [K in keyof O["whens"]]: (...Iw: O["whens"][K]) => (zel: I["iselection"], tr: ITTestResourceConfiguration, utils: PM) => Promise<I["when"]>;
73
71
  };
74
- export type TestThenImplementation<I extends IT, O extends OT> = {
72
+ export type TestThenImplementation<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
75
73
  [K in keyof O["thens"]]: (...It: O["thens"][K]) => (ssel: I["iselection"], utils: PM) => I["then"];
76
74
  };
77
- export type TestCheckImplementation<I extends IT, O extends OT> = {
75
+ export type TestCheckImplementation<I extends Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>, O extends Ibdd_out<TestSuiteShape, TestGivenShape, TestWhenShape, TestThenShape, TestCheckShape>> = {
78
76
  [K in keyof O["checks"]]: (...Ic: O["checks"][K]) => I["given"];
79
77
  };
80
- export type ITestImplementation<I extends IT, O extends OT, modifier = {
81
- whens: TestWhenImplementation<I, O>;
82
- }> = Modify<{
83
- suites: TestSuiteImplementation<O>;
84
- givens: TestGivenImplementation<I, O>;
85
- whens: TestWhenImplementation<I, O>;
86
- thens: TestThenImplementation<I, O>;
87
- checks: TestCheckImplementation<I, O>;
88
- }, modifier>;
89
78
  export type Modify<T, R> = Omit<T, keyof R> & R;
90
79
  export type TestSuiteShape = Record<string, any>;
91
80
  export type TestGivenShape = Record<string, any>;
92
81
  export type TestWhenShape = Record<string, any>;
93
82
  export type TestThenShape = Record<string, any>;
94
83
  export type TestCheckShape = Record<string, any>;
95
- export type Ibdd_out<ISuites extends TestSuiteShape = TestSuiteShape, IGivens extends TestGivenShape = TestGivenShape, IWhens extends TestWhenShape = TestWhenShape, IThens extends TestThenShape = TestThenShape, IChecks extends TestCheckShape = TestCheckShape> = {
96
- suites: ISuites;
97
- givens: IGivens;
98
- whens: IWhens;
99
- thens: IThens;
100
- checks: IChecks;
101
- };
102
- /**
103
- * Defines the input shape for BDD test definitions.
104
- * This is the core type that structures all test operations.
105
- */
106
- export type Ibdd_in<IInput, // Type of initial test input
107
- ISubject, // Type of object being tested
108
- IStore, // Type for storing test state between steps
109
- ISelection, // Type for selecting state for assertions
110
- IGiven, // Type for Given step functions
111
- IWhen, // Type for When step functions
112
- IThen> = {
113
- /** Initial input required to start tests */
114
- iinput: IInput;
115
- /** The subject being tested (class, function, etc) */
116
- isubject: ISubject;
117
- /** Complete test state storage */
118
- istore: IStore;
119
- /** Selected portion of state for assertions */
120
- iselection: ISelection;
121
- /** Function type for Given steps */
122
- given: IGiven;
123
- /** Function type for When steps */
124
- when: IWhen;
125
- /** Function type for Then steps */
126
- then: IThen;
127
- };
128
84
  export type IPluginFactory = (register?: (entrypoint: string, sources: string[]) => any, entrypoints?: string[]) => Plugin;
129
85
  export type IRunTime = `node` | `web` | "pure" | `spawn`;
130
86
  export type ITestTypes = [string, IRunTime, {
@@ -1,4 +1,4 @@
1
- import type { IT, ITestImplementation, ITestInterface, ITestSpecification, IWebTestInterface, OT } from "./Types";
1
+ import type { ITestImplementation, ITestInterface, ITestSpecification } from "./Types";
2
2
  import Testeranto from "./lib/core.js";
3
3
  import { ITTestResourceRequest } from "./lib/index.js";
4
4
  export declare class WebTesteranto<I extends IT, O extends OT, M> extends Testeranto<I, O, M> {
@@ -0,0 +1,6 @@
1
+ import { IRunTime } from "../lib";
2
+ declare const _default: (r: IRunTime) => {
3
+ name: string;
4
+ setup: (build: any) => void;
5
+ };
6
+ export default _default;
@@ -18,10 +18,7 @@ export declare abstract class BaseSuite<I extends IT = IT, O extends OT = OT> {
18
18
  givens: {
19
19
  key: string;
20
20
  name: string;
21
- whens: {
22
- name: string;
23
- error: string;
24
- }[];
21
+ whens: {}[];
25
22
  thens: {
26
23
  name: string;
27
24
  error: boolean;
@@ -58,10 +55,7 @@ export declare abstract class BaseGiven<I extends IT = IT> {
58
55
  toObj(): {
59
56
  key: string;
60
57
  name: string;
61
- whens: {
62
- name: string;
63
- error: string;
64
- }[];
58
+ whens: {}[];
65
59
  thens: {
66
60
  name: string;
67
61
  error: boolean;
@@ -1,6 +1,6 @@
1
- import { ITestSpecification, ITestImplementation, ITestInterface, IT, OT } from "../Types.js";
2
1
  import { IFinalResults, ITTestResourceRequest } from "./index.js";
3
2
  import { ClassBuilder } from "./classBuilder.js";
3
+ import { ITestSpecification, ITestImplementation, ITestInterface } from "../CoreTypes.js";
4
4
  export default abstract class Testeranto<I extends IT, O extends OT, M> extends ClassBuilder<I, O, M> {
5
5
  constructor(input: I["iinput"], testSpecification: ITestSpecification<I, O>, testImplementation: ITestImplementation<I, O, M> & {
6
6
  suites: Record<string, any>;
@@ -1,21 +1,2 @@
1
- import { Ibdd_out, Ibdd_in } from "../Types";
2
- import type { Express } from "express";
3
- type I = Ibdd_in<(port: number) => Express, (port: number) => Express, any, any, any, any, any>;
4
- type O = Ibdd_out<{
5
- TheMothership: [null];
6
- }, {
7
- ItIsRunning: [];
8
- }, {
9
- IClaimTheResource: [string];
10
- IReleaseTheResource: [string];
11
- IResetTheResource: [string];
12
- }, {
13
- TheResourceIsClaimed: [string];
14
- TheResourceIsUnClaimed: [string];
15
- }, {
16
- AnEmptyState: any;
17
- }>;
18
- declare const _default: Promise<import("../lib/core").default<IT, O, {
19
- whens: import("../Types").TestWhenImplementation<I, O>;
20
- }>>;
1
+ declare const _default: Promise<import("../lib/core").default<IT, OT, any>>;
21
2
  export default _default;