@goodie-ts/testing 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 GOOD Code ApS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ export { getMockTarget, MockDefinition, MockDefinitionError, } from './mock-definition.js';
2
+ export { OverrideBuilder, TestContext, TestContextBuilder, } from './test-context.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,eAAe,EACf,WAAW,EACX,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { getMockTarget, MockDefinition, MockDefinitionError, } from './mock-definition.js';
2
+ export { OverrideBuilder, TestContext, TestContextBuilder, } from './test-context.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,eAAe,EACf,WAAW,EACX,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type Constructor, DIError, type InjectionToken } from '@goodie-ts/core';
2
+ /** The types accepted by @MockDefinition as the target to override. */
3
+ type MockTarget = Constructor | InjectionToken<unknown> | string;
4
+ /**
5
+ * Thrown when @MockDefinition metadata is missing or the target cannot be resolved.
6
+ */
7
+ export declare class MockDefinitionError extends DIError {
8
+ constructor(message: string);
9
+ }
10
+ /**
11
+ * Class decorator that marks a mock class with the production bean it replaces.
12
+ *
13
+ * @param target - The Constructor, InjectionToken, or string description to override
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * @MockDefinition(UserRepository)
18
+ * class MockUserRepository { ... }
19
+ *
20
+ * @MockDefinition('Repository<User>')
21
+ * class MockUserRepo { ... }
22
+ * ```
23
+ */
24
+ export declare function MockDefinition(target: MockTarget): (_value: new (...args: any[]) => any, context: ClassDecoratorContext) => void;
25
+ /**
26
+ * Read the @MockDefinition target from a decorated class.
27
+ * Returns `undefined` if the class has no @MockDefinition annotation.
28
+ */
29
+ export declare function getMockTarget(cls: Constructor): MockTarget | undefined;
30
+ export {};
31
+ //# sourceMappingURL=mock-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-definition.d.ts","sourceRoot":"","sources":["../src/mock-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,OAAO,EACP,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAKzB,uEAAuE;AACvE,KAAK,UAAU,GAAG,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;AAEjE;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO;gBAClC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,IAE7C,QAAQ,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACnC,SAAS,qBAAqB,UAIjC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CAKtE"}
@@ -0,0 +1,40 @@
1
+ import { DIError, } from '@goodie-ts/core';
2
+ /** Well-known metadata key for @MockDefinition target. */
3
+ const MOCK_TARGET = Symbol('goodie:mock-target');
4
+ /**
5
+ * Thrown when @MockDefinition metadata is missing or the target cannot be resolved.
6
+ */
7
+ export class MockDefinitionError extends DIError {
8
+ constructor(message) {
9
+ super(message);
10
+ this.name = 'MockDefinitionError';
11
+ }
12
+ }
13
+ /**
14
+ * Class decorator that marks a mock class with the production bean it replaces.
15
+ *
16
+ * @param target - The Constructor, InjectionToken, or string description to override
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * @MockDefinition(UserRepository)
21
+ * class MockUserRepository { ... }
22
+ *
23
+ * @MockDefinition('Repository<User>')
24
+ * class MockUserRepo { ... }
25
+ * ```
26
+ */
27
+ export function MockDefinition(target) {
28
+ return (_value, context) => {
29
+ context.metadata[MOCK_TARGET] = target;
30
+ };
31
+ }
32
+ /**
33
+ * Read the @MockDefinition target from a decorated class.
34
+ * Returns `undefined` if the class has no @MockDefinition annotation.
35
+ */
36
+ export function getMockTarget(cls) {
37
+ const metadata = cls[Symbol.metadata];
38
+ return metadata?.[MOCK_TARGET];
39
+ }
40
+ //# sourceMappingURL=mock-definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-definition.js","sourceRoot":"","sources":["../src/mock-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,GAER,MAAM,iBAAiB,CAAC;AAEzB,0DAA0D;AAC1D,MAAM,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAKjD;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,OAAO;IAC9C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,MAAkB;IAC/C,OAAO,CACL,MAAmC,EACnC,OAA8B,EAC9B,EAAE;QACD,OAAO,CAAC,QAAyC,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC;IAC3E,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAgB;IAC5C,MAAM,QAAQ,GACZ,GACD,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnB,OAAO,QAAQ,EAAE,CAAC,WAAW,CAA2B,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { ApplicationContext, type BeanDefinition, type Constructor, InjectionToken } from '@goodie-ts/core';
2
+ type Token = InjectionToken<unknown> | Constructor;
3
+ /**
4
+ * Fluent builder for configuring a single bean override.
5
+ */
6
+ export declare class OverrideBuilder<T> {
7
+ private readonly token;
8
+ private readonly commit;
9
+ constructor(token: Token, commit: (def: BeanDefinition) => void);
10
+ /**
11
+ * Override with a fixed value instance.
12
+ */
13
+ withValue(value: T): TestContextBuilder;
14
+ /**
15
+ * Override with a replacement class (zero-dependency, `new cls()`).
16
+ */
17
+ with(cls: Constructor<T>): TestContextBuilder;
18
+ /**
19
+ * Override with a custom factory function (sync or async).
20
+ */
21
+ withFactory(factory: () => T | Promise<T>): TestContextBuilder;
22
+ }
23
+ /**
24
+ * Accumulates bean overrides and builds a fresh ApplicationContext.
25
+ */
26
+ export declare class TestContextBuilder {
27
+ private readonly baseDefs;
28
+ private readonly overrides;
29
+ private readonly tokenSet;
30
+ /** @internal — use TestContext.from() */
31
+ constructor(baseDefs: BeanDefinition[]);
32
+ /**
33
+ * Start overriding a bean identified by its class constructor.
34
+ * Throws OverrideError if the token doesn't exist in the base definitions.
35
+ */
36
+ override<T>(token: Constructor<T> | InjectionToken<T>): OverrideBuilder<T>;
37
+ /**
38
+ * Register one or more @MockDefinition-annotated classes as overrides.
39
+ *
40
+ * Each class must be decorated with @MockDefinition(target) — the framework
41
+ * resolves the target (Constructor, InjectionToken, or string description),
42
+ * validates it exists, and stores the override (zero-dependency `new cls()`).
43
+ */
44
+ mock(...classes: Constructor[]): TestContextBuilder;
45
+ /**
46
+ * Resolve a MockDefinition target to a Token usable for override lookup.
47
+ * - Constructor / InjectionToken → returned as-is
48
+ * - string → find InjectionToken in base defs by description (must be unique)
49
+ */
50
+ private resolveTarget;
51
+ /**
52
+ * Build a fresh ApplicationContext with all overrides applied.
53
+ */
54
+ build(): Promise<ApplicationContext>;
55
+ }
56
+ /**
57
+ * Entry point for creating test-friendly ApplicationContexts with bean overrides.
58
+ */
59
+ export declare class TestContext {
60
+ private constructor();
61
+ /**
62
+ * Create a TestContextBuilder from an existing ApplicationContext or raw BeanDefinitions.
63
+ */
64
+ static from(source: ApplicationContext | BeanDefinition[]): TestContextBuilder;
65
+ }
66
+ export {};
67
+ //# sourceMappingURL=test-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-context.d.ts","sourceRoot":"","sources":["../src/test-context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAGzB,KAAK,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC;AASnD;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC;IAE1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI;IAGxD;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,kBAAkB;IAavC;;OAEG;IACH,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,kBAAkB;IAa7C;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,kBAAkB;CAY/D;AAMD;;GAEG;AACH,qBAAa,kBAAkB;IAKjB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAC9D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IAEtC,yCAAyC;gBACZ,QAAQ,EAAE,cAAc,EAAE;IAIvD;;;OAGG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC;IAU1E;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,OAAO,EAAE,WAAW,EAAE,GAAG,kBAAkB;IA6BnD;;;;OAIG;IACH,OAAO,CAAC,aAAa;IA+BrB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,kBAAkB,CAAC;CAM3C;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO;IAEP;;OAEG;IACH,MAAM,CAAC,IAAI,CACT,MAAM,EAAE,kBAAkB,GAAG,cAAc,EAAE,GAC5C,kBAAkB;CAItB"}
@@ -0,0 +1,167 @@
1
+ import { ApplicationContext, InjectionToken, OverrideError, } from '@goodie-ts/core';
2
+ import { getMockTarget, MockDefinitionError } from './mock-definition.js';
3
+ function tokenName(token) {
4
+ if (typeof token === 'function') {
5
+ return token.name || 'Anonymous';
6
+ }
7
+ return token.description;
8
+ }
9
+ /**
10
+ * Fluent builder for configuring a single bean override.
11
+ */
12
+ export class OverrideBuilder {
13
+ token;
14
+ commit;
15
+ constructor(token, commit) {
16
+ this.token = token;
17
+ this.commit = commit;
18
+ }
19
+ /**
20
+ * Override with a fixed value instance.
21
+ */
22
+ withValue(value) {
23
+ const def = {
24
+ token: this.token,
25
+ scope: 'singleton',
26
+ dependencies: [],
27
+ factory: () => value,
28
+ eager: false,
29
+ metadata: {},
30
+ };
31
+ this.commit(def);
32
+ return builder;
33
+ }
34
+ /**
35
+ * Override with a replacement class (zero-dependency, `new cls()`).
36
+ */
37
+ with(cls) {
38
+ const def = {
39
+ token: this.token,
40
+ scope: 'singleton',
41
+ dependencies: [],
42
+ factory: () => new cls(),
43
+ eager: false,
44
+ metadata: {},
45
+ };
46
+ this.commit(def);
47
+ return builder;
48
+ }
49
+ /**
50
+ * Override with a custom factory function (sync or async).
51
+ */
52
+ withFactory(factory) {
53
+ const def = {
54
+ token: this.token,
55
+ scope: 'singleton',
56
+ dependencies: [],
57
+ factory,
58
+ eager: false,
59
+ metadata: {},
60
+ };
61
+ this.commit(def);
62
+ return builder;
63
+ }
64
+ }
65
+ // Module-level reference that OverrideBuilder methods return.
66
+ // Set by TestContextBuilder before creating OverrideBuilder instances.
67
+ let builder;
68
+ /**
69
+ * Accumulates bean overrides and builds a fresh ApplicationContext.
70
+ */
71
+ export class TestContextBuilder {
72
+ baseDefs;
73
+ overrides = new Map();
74
+ tokenSet;
75
+ /** @internal — use TestContext.from() */
76
+ constructor(baseDefs) {
77
+ this.baseDefs = baseDefs;
78
+ this.tokenSet = new Set(baseDefs.map((d) => d.token));
79
+ }
80
+ /**
81
+ * Start overriding a bean identified by its class constructor.
82
+ * Throws OverrideError if the token doesn't exist in the base definitions.
83
+ */
84
+ override(token) {
85
+ if (!this.tokenSet.has(token)) {
86
+ throw new OverrideError(tokenName(token));
87
+ }
88
+ builder = this;
89
+ return new OverrideBuilder(token, (def) => {
90
+ this.overrides.set(def.token, def);
91
+ });
92
+ }
93
+ /**
94
+ * Register one or more @MockDefinition-annotated classes as overrides.
95
+ *
96
+ * Each class must be decorated with @MockDefinition(target) — the framework
97
+ * resolves the target (Constructor, InjectionToken, or string description),
98
+ * validates it exists, and stores the override (zero-dependency `new cls()`).
99
+ */
100
+ mock(...classes) {
101
+ for (const cls of classes) {
102
+ const target = getMockTarget(cls);
103
+ if (target === undefined) {
104
+ throw new MockDefinitionError(`${cls.name || 'Anonymous'} is not annotated with @MockDefinition`);
105
+ }
106
+ const token = this.resolveTarget(target, cls);
107
+ if (!this.tokenSet.has(token)) {
108
+ throw new OverrideError(tokenName(token));
109
+ }
110
+ const def = {
111
+ token,
112
+ scope: 'singleton',
113
+ dependencies: [],
114
+ factory: () => new cls(),
115
+ eager: false,
116
+ metadata: {},
117
+ };
118
+ this.overrides.set(token, def);
119
+ }
120
+ return this;
121
+ }
122
+ /**
123
+ * Resolve a MockDefinition target to a Token usable for override lookup.
124
+ * - Constructor / InjectionToken → returned as-is
125
+ * - string → find InjectionToken in base defs by description (must be unique)
126
+ */
127
+ resolveTarget(target, mockCls) {
128
+ if (typeof target === 'string') {
129
+ const matches = [];
130
+ for (const def of this.baseDefs) {
131
+ if (def.token instanceof InjectionToken &&
132
+ def.token.description === target) {
133
+ matches.push(def.token);
134
+ }
135
+ }
136
+ if (matches.length === 0) {
137
+ throw new MockDefinitionError(`${mockCls.name || 'Anonymous'} targets InjectionToken "${target}" but no such token exists in the definitions`);
138
+ }
139
+ if (matches.length > 1) {
140
+ throw new MockDefinitionError(`${mockCls.name || 'Anonymous'} targets InjectionToken "${target}" but ${matches.length} tokens share that description — pass the InjectionToken instance directly to disambiguate`);
141
+ }
142
+ return matches[0];
143
+ }
144
+ return target;
145
+ }
146
+ /**
147
+ * Build a fresh ApplicationContext with all overrides applied.
148
+ */
149
+ async build() {
150
+ const merged = this.baseDefs.map((def) => this.overrides.get(def.token) ?? def);
151
+ return ApplicationContext.create(merged);
152
+ }
153
+ }
154
+ /**
155
+ * Entry point for creating test-friendly ApplicationContexts with bean overrides.
156
+ */
157
+ export class TestContext {
158
+ constructor() { }
159
+ /**
160
+ * Create a TestContextBuilder from an existing ApplicationContext or raw BeanDefinitions.
161
+ */
162
+ static from(source) {
163
+ const defs = Array.isArray(source) ? source : source.getDefinitions();
164
+ return new TestContextBuilder([...defs]);
165
+ }
166
+ }
167
+ //# sourceMappingURL=test-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-context.js","sourceRoot":"","sources":["../src/test-context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAI1E,SAAS,SAAS,CAAC,KAAY;IAC7B,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,IAAI,IAAI,WAAW,CAAC;IACnC,CAAC;IACD,OAAO,KAAK,CAAC,WAAW,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,eAAe;IAEP;IACA;IAFnB,YACmB,KAAY,EACZ,MAAqC;QADrC,UAAK,GAAL,KAAK,CAAO;QACZ,WAAM,GAAN,MAAM,CAA+B;IACrD,CAAC;IAEJ;;OAEG;IACH,SAAS,CAAC,KAAQ;QAChB,MAAM,GAAG,GAAmB;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,WAAW;YAClB,YAAY,EAAE,EAAE;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;YACpB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,EAAE;SACb,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED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,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@goodie-ts/testing",
3
+ "version": "0.1.0",
4
+ "description": "Test utilities for goodie-ts with bean overrides and mock definitions",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/GOOD-Code-ApS/goodie.git",
10
+ "directory": "packages/testing"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "main": "dist/index.js",
16
+ "types": "dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "dependencies": {
24
+ "@goodie-ts/core": "0.1.0"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "scripts": {
30
+ "build": "tsc",
31
+ "clean": "rm -rf dist *.tsbuildinfo"
32
+ }
33
+ }