@fluojs/testing 1.0.5 → 2.0.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/README.ko.md +38 -30
- package/README.md +40 -32
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +3 -1
- package/dist/conformance/platform-conformance.d.ts.map +1 -1
- package/dist/conformance/platform-conformance.js +95 -67
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/mock-types.d.ts +2 -0
- package/dist/mock-types.d.ts.map +1 -0
- package/dist/mock-types.js +1 -0
- package/dist/mock.d.ts +3 -2
- package/dist/mock.d.ts.map +1 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +92 -99
- package/dist/portability/http-adapter-portability.d.ts +1 -7
- package/dist/portability/http-adapter-portability.d.ts.map +1 -1
- package/dist/portability/http-adapter-portability.js +33 -7
- package/dist/portability/web-runtime-adapter-portability.d.ts +1 -7
- package/dist/portability/web-runtime-adapter-portability.d.ts.map +1 -1
- package/dist/types.d.ts +64 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/vitest/tooling.d.ts +2 -2
- package/dist/vitest/tooling.d.ts.map +1 -1
- package/dist/vitest/tooling.js +89 -34
- package/package.json +12 -12
package/dist/module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getModuleMetadata } from '@fluojs/core';
|
|
2
|
-
import { isForwardRef, isOptionalToken, Scope } from '@fluojs/di';
|
|
3
|
-
import { bootstrapModule
|
|
2
|
+
import { isForwardRef, isOptionalToken, RequestScopeResolutionError, Scope } from '@fluojs/di';
|
|
3
|
+
import { bootstrapModule } from '@fluojs/runtime';
|
|
4
4
|
import { createDispatcher, createHandlerMapping } from '@fluojs/http';
|
|
5
5
|
import { createTestRequestContextMiddleware, makeRequest } from './http.js';
|
|
6
6
|
/**
|
|
@@ -45,9 +45,10 @@ export function extractModuleImports(moduleType) {
|
|
|
45
45
|
return metadata.imports;
|
|
46
46
|
}
|
|
47
47
|
function createHandlerSources(bootstrappedModules) {
|
|
48
|
+
const globalModules = bootstrappedModules.filter(compiledModule => compiledModule.definition.global);
|
|
48
49
|
return bootstrappedModules.flatMap(compiledModule => (compiledModule.definition.controllers ?? []).map(controllerToken => ({
|
|
49
50
|
controllerToken,
|
|
50
|
-
moduleMiddleware: compiledModule.definition.middleware ?? [],
|
|
51
|
+
moduleMiddleware: [...globalModules.filter(globalModule => globalModule !== compiledModule).flatMap(globalModule => globalModule.definition.middleware ?? []), ...(compiledModule.definition.middleware ?? [])],
|
|
51
52
|
moduleType: compiledModule.type
|
|
52
53
|
})));
|
|
53
54
|
}
|
|
@@ -133,16 +134,16 @@ async function instantiateLifecycleProvider(provider, bootstrapped, introspectio
|
|
|
133
134
|
return new provider.useClass(...dependencies);
|
|
134
135
|
}
|
|
135
136
|
async function resolveMultiLifecycleProvider(provider, bootstrapped, introspection) {
|
|
136
|
-
const
|
|
137
|
-
const cached =
|
|
137
|
+
const rootIntrospection = rootContainerIntrospection(introspection);
|
|
138
|
+
const cached = rootIntrospection.multiSingletonCache.get(provider);
|
|
138
139
|
if (cached) {
|
|
139
140
|
return cached;
|
|
140
141
|
}
|
|
141
142
|
const instance = instantiateLifecycleProvider(provider, bootstrapped, introspection).catch(error => {
|
|
142
|
-
|
|
143
|
+
rootIntrospection.cacheOwner.deleteMultiSingleton(provider);
|
|
143
144
|
throw error;
|
|
144
145
|
});
|
|
145
|
-
|
|
146
|
+
rootIntrospection.cacheOwner.setMultiSingleton(provider, instance);
|
|
146
147
|
return instance;
|
|
147
148
|
}
|
|
148
149
|
async function resolveTestingLifecycleInstances(bootstrapped, overrides = []) {
|
|
@@ -176,7 +177,7 @@ async function resolveTestingLifecycleInstances(bootstrapped, overrides = []) {
|
|
|
176
177
|
}
|
|
177
178
|
instances.push(await bootstrapped.container.resolve(token));
|
|
178
179
|
} catch (error) {
|
|
179
|
-
if (error instanceof
|
|
180
|
+
if (error instanceof RequestScopeResolutionError) {
|
|
180
181
|
continue;
|
|
181
182
|
}
|
|
182
183
|
throw error;
|
|
@@ -228,30 +229,6 @@ function dependencyToken(entry) {
|
|
|
228
229
|
}
|
|
229
230
|
return entry;
|
|
230
231
|
}
|
|
231
|
-
function trackFactoryResolutionKind(provider, factoryResolutionKinds) {
|
|
232
|
-
if (provider.type !== 'factory' || !provider.useFactory) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
const originalFactory = provider.useFactory;
|
|
236
|
-
provider.useFactory = (...deps) => {
|
|
237
|
-
const value = originalFactory(...deps);
|
|
238
|
-
factoryResolutionKinds.set(provider, isPromiseLike(value) ? 'async' : 'sync');
|
|
239
|
-
return value;
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
function installFactoryResolutionTracking(target, factoryResolutionKinds) {
|
|
243
|
-
if (target.parent) {
|
|
244
|
-
installFactoryResolutionTracking(target.parent, factoryResolutionKinds);
|
|
245
|
-
}
|
|
246
|
-
for (const provider of target.registrations.values()) {
|
|
247
|
-
trackFactoryResolutionKind(provider, factoryResolutionKinds);
|
|
248
|
-
}
|
|
249
|
-
for (const providers of target.multiRegistrations.values()) {
|
|
250
|
-
for (const provider of providers) {
|
|
251
|
-
trackFactoryResolutionKind(provider, factoryResolutionKinds);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
232
|
function providerGraphIsSyncResolvable(state, token, visited = new Set()) {
|
|
256
233
|
if (visited.has(token)) {
|
|
257
234
|
return true;
|
|
@@ -332,6 +309,7 @@ function instantiateSyncProvider(provider, state) {
|
|
|
332
309
|
if (isPromiseLike(value)) {
|
|
333
310
|
throw new Error(`Token ${String(provider.provide)} requires async resolution. Use resolve() instead of get() for async providers.`);
|
|
334
311
|
}
|
|
312
|
+
state.cacheOwner.recordFactoryResolution(provider, 'sync');
|
|
335
313
|
return value;
|
|
336
314
|
}
|
|
337
315
|
case 'class':
|
|
@@ -355,15 +333,20 @@ function resolveSyncProvider(provider, state) {
|
|
|
355
333
|
if (provider.scope === 'transient') {
|
|
356
334
|
return instantiateSyncProvider(provider, state);
|
|
357
335
|
}
|
|
358
|
-
|
|
359
|
-
|
|
336
|
+
const memo = state.syncSingletonValues.get(provider.provide);
|
|
337
|
+
if (memo) {
|
|
338
|
+
return memo.value;
|
|
360
339
|
}
|
|
361
340
|
if (state.singletonCache.has(provider.provide)) {
|
|
362
341
|
throw new Error(`Token ${String(provider.provide)} was already resolved asynchronously. Use resolve() instead of get() for this provider.`);
|
|
363
342
|
}
|
|
364
343
|
const instance = instantiateSyncProvider(provider, state);
|
|
365
|
-
|
|
366
|
-
state.
|
|
344
|
+
const cacheEntry = Promise.resolve(instance);
|
|
345
|
+
state.syncSingletonValues.set(provider.provide, {
|
|
346
|
+
cacheEntry,
|
|
347
|
+
value: instance
|
|
348
|
+
});
|
|
349
|
+
state.cacheOwner.setSingleton(provider.provide, cacheEntry);
|
|
367
350
|
return instance;
|
|
368
351
|
}
|
|
369
352
|
function resolveSyncMultiProvider(provider, state) {
|
|
@@ -373,15 +356,20 @@ function resolveSyncMultiProvider(provider, state) {
|
|
|
373
356
|
if (provider.scope === 'transient') {
|
|
374
357
|
return instantiateSyncProvider(provider, state);
|
|
375
358
|
}
|
|
376
|
-
|
|
377
|
-
|
|
359
|
+
const memo = state.syncMultiSingletonValues.get(provider);
|
|
360
|
+
if (memo) {
|
|
361
|
+
return memo.value;
|
|
378
362
|
}
|
|
379
363
|
if (state.multiSingletonCache.has(provider)) {
|
|
380
364
|
throw new Error(`Token ${String(provider.provide)} was already resolved asynchronously. Use resolve() instead of get() for this provider.`);
|
|
381
365
|
}
|
|
382
366
|
const instance = instantiateSyncProvider(provider, state);
|
|
383
|
-
|
|
384
|
-
state.
|
|
367
|
+
const cacheEntry = Promise.resolve(instance);
|
|
368
|
+
state.syncMultiSingletonValues.set(provider, {
|
|
369
|
+
cacheEntry,
|
|
370
|
+
value: instance
|
|
371
|
+
});
|
|
372
|
+
state.cacheOwner.setMultiSingleton(provider, cacheEntry);
|
|
385
373
|
return instance;
|
|
386
374
|
}
|
|
387
375
|
function resolveSyncToken(token, state) {
|
|
@@ -405,31 +393,60 @@ function resolveSyncToken(token, state) {
|
|
|
405
393
|
}
|
|
406
394
|
function createSyncResolver(container) {
|
|
407
395
|
const introspection = toContainerIntrospection(container);
|
|
408
|
-
const
|
|
409
|
-
installFactoryResolutionTracking(introspection, factoryResolutionKinds);
|
|
396
|
+
const rootIntrospection = rootContainerIntrospection(introspection);
|
|
410
397
|
const state = {
|
|
411
|
-
|
|
398
|
+
cacheOwner: rootIntrospection.cacheOwner,
|
|
399
|
+
factoryResolutionKinds: rootIntrospection.factoryResolutionKinds,
|
|
412
400
|
introspection,
|
|
413
|
-
multiSingletonCache:
|
|
401
|
+
multiSingletonCache: rootIntrospection.multiSingletonCache,
|
|
414
402
|
resolutionChain: new Set(),
|
|
415
|
-
singletonCache:
|
|
403
|
+
singletonCache: rootIntrospection.singletonCache,
|
|
416
404
|
syncMultiSingletonValues: new Map(),
|
|
417
405
|
syncSingletonValues: new Map()
|
|
418
406
|
};
|
|
407
|
+
const refreshState = () => {
|
|
408
|
+
const freshIntrospection = toContainerIntrospection(container);
|
|
409
|
+
const freshRootIntrospection = rootContainerIntrospection(freshIntrospection);
|
|
410
|
+
state.cacheOwner = freshRootIntrospection.cacheOwner;
|
|
411
|
+
state.factoryResolutionKinds = freshRootIntrospection.factoryResolutionKinds;
|
|
412
|
+
state.introspection = freshIntrospection;
|
|
413
|
+
state.multiSingletonCache = freshRootIntrospection.multiSingletonCache;
|
|
414
|
+
state.singletonCache = freshRootIntrospection.singletonCache;
|
|
415
|
+
for (const [token, memo] of state.syncSingletonValues) {
|
|
416
|
+
if (state.singletonCache.get(token) !== memo.cacheEntry) {
|
|
417
|
+
state.syncSingletonValues.delete(token);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
for (const [provider, memo] of state.syncMultiSingletonValues) {
|
|
421
|
+
if (state.multiSingletonCache.get(provider) !== memo.cacheEntry) {
|
|
422
|
+
state.syncMultiSingletonValues.delete(provider);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
};
|
|
419
426
|
return {
|
|
420
|
-
get: token =>
|
|
427
|
+
get: token => {
|
|
428
|
+
refreshState();
|
|
429
|
+
return resolveSyncToken(token, state);
|
|
430
|
+
},
|
|
421
431
|
syncFromContainer: async () => {
|
|
432
|
+
refreshState();
|
|
422
433
|
for (const [token, promise] of state.singletonCache) {
|
|
423
434
|
if (!canPromoteCachedSingleton(state, token)) {
|
|
424
435
|
continue;
|
|
425
436
|
}
|
|
426
|
-
state.syncSingletonValues.set(token,
|
|
437
|
+
state.syncSingletonValues.set(token, {
|
|
438
|
+
cacheEntry: promise,
|
|
439
|
+
value: await promise
|
|
440
|
+
});
|
|
427
441
|
}
|
|
428
442
|
for (const [provider, promise] of state.multiSingletonCache) {
|
|
429
443
|
if (!providerGraphForProviderIsSyncResolvable(state, provider)) {
|
|
430
444
|
continue;
|
|
431
445
|
}
|
|
432
|
-
state.syncMultiSingletonValues.set(provider,
|
|
446
|
+
state.syncMultiSingletonValues.set(provider, {
|
|
447
|
+
cacheEntry: promise,
|
|
448
|
+
value: await promise
|
|
449
|
+
});
|
|
433
450
|
}
|
|
434
451
|
}
|
|
435
452
|
};
|
|
@@ -469,7 +486,6 @@ class DefaultOverrideProviderBuilder {
|
|
|
469
486
|
class DefaultTestingModuleBuilder {
|
|
470
487
|
overrides = [];
|
|
471
488
|
moduleReplacements = new Map();
|
|
472
|
-
originalModuleDefinitions = new Map();
|
|
473
489
|
constructor(options) {
|
|
474
490
|
this.options = options;
|
|
475
491
|
}
|
|
@@ -528,24 +544,23 @@ class DefaultTestingModuleBuilder {
|
|
|
528
544
|
const syncResolver = createSyncResolver(bootstrapped.container);
|
|
529
545
|
await runTestingBootstrapLifecycle(bootstrapped, this.overrides);
|
|
530
546
|
await syncResolver.syncFromContainer();
|
|
547
|
+
const resolve = bootstrapped.container.resolve.bind(bootstrapped.container);
|
|
548
|
+
bootstrapped.container.resolve = async token => {
|
|
549
|
+
const value = await resolve(token);
|
|
550
|
+
await syncResolver.syncFromContainer();
|
|
551
|
+
return value;
|
|
552
|
+
};
|
|
531
553
|
return this.createTestingModuleRef(bootstrapped, syncResolver);
|
|
532
554
|
}
|
|
533
555
|
bootstrapTestingModule() {
|
|
534
|
-
const bootstrapped = this.
|
|
556
|
+
const bootstrapped = this.bootstrapWithModuleReplacements();
|
|
535
557
|
if (this.overrides.length > 0) {
|
|
536
558
|
bootstrapped.container.override(...this.overrides);
|
|
537
559
|
}
|
|
538
560
|
return bootstrapped;
|
|
539
561
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
const rootModule = this._applyModuleReplacements(this.options.rootModule);
|
|
543
|
-
return bootstrapModule(rootModule, {
|
|
544
|
-
providers: this.options.providers
|
|
545
|
-
});
|
|
546
|
-
} finally {
|
|
547
|
-
this.restorePatchedModuleImports();
|
|
548
|
-
}
|
|
562
|
+
bootstrapWithModuleReplacements() {
|
|
563
|
+
return bootstrapModule(this.options.rootModule, this.createBootstrapModuleOptions());
|
|
549
564
|
}
|
|
550
565
|
createTestingModuleRef(bootstrapped, syncResolver) {
|
|
551
566
|
const dispatcher = createTestingDispatcher(bootstrapped);
|
|
@@ -553,11 +568,7 @@ class DefaultTestingModuleBuilder {
|
|
|
553
568
|
...bootstrapped,
|
|
554
569
|
has: token => bootstrapped.container.has(token),
|
|
555
570
|
get: token => syncResolver.get(token),
|
|
556
|
-
resolve:
|
|
557
|
-
const value = await bootstrapped.container.resolve(token);
|
|
558
|
-
await syncResolver.syncFromContainer();
|
|
559
|
-
return value;
|
|
560
|
-
},
|
|
571
|
+
resolve: token => bootstrapped.container.resolve(token),
|
|
561
572
|
resolveAll: async tokens => {
|
|
562
573
|
const results = [];
|
|
563
574
|
const errors = [];
|
|
@@ -578,7 +589,6 @@ class DefaultTestingModuleBuilder {
|
|
|
578
589
|
}) => ` - ${String(token)}: ${error instanceof Error ? error.message : String(error)}`).join('\n');
|
|
579
590
|
throw new Error(`Failed to resolve ${errors.length} of ${tokens.length} tokens:\n${summary}`);
|
|
580
591
|
}
|
|
581
|
-
await syncResolver.syncFromContainer();
|
|
582
592
|
return results;
|
|
583
593
|
},
|
|
584
594
|
dispatch: async request => {
|
|
@@ -588,43 +598,26 @@ class DefaultTestingModuleBuilder {
|
|
|
588
598
|
}
|
|
589
599
|
};
|
|
590
600
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
return module;
|
|
602
|
-
}
|
|
603
|
-
const rewrittenImports = this.rewriteModuleImports(metadata.imports);
|
|
604
|
-
const hasChange = rewrittenImports.some((imp, i) => imp !== metadata.imports[i]);
|
|
605
|
-
if (!hasChange) {
|
|
606
|
-
return module;
|
|
607
|
-
}
|
|
608
|
-
this.patchModuleImports(module, metadata, rewrittenImports);
|
|
609
|
-
return module;
|
|
610
|
-
}
|
|
611
|
-
rewriteModuleImports(imports) {
|
|
612
|
-
return imports.map(moduleImport => this._applyModuleReplacements(moduleImport));
|
|
601
|
+
createBootstrapModuleOptions() {
|
|
602
|
+
const moduleReplacements = this.createModuleReplacements();
|
|
603
|
+
return {
|
|
604
|
+
duplicateProviderPolicy: this.options.duplicateProviderPolicy,
|
|
605
|
+
logger: this.options.logger,
|
|
606
|
+
moduleGraphCache: this.options.moduleGraphCache,
|
|
607
|
+
moduleReplacements,
|
|
608
|
+
providers: this.options.providers,
|
|
609
|
+
validationTokens: this.options.validationTokens
|
|
610
|
+
};
|
|
613
611
|
}
|
|
614
|
-
|
|
615
|
-
if (!this.
|
|
616
|
-
|
|
612
|
+
createModuleReplacements() {
|
|
613
|
+
if (!this.options.moduleReplacements && this.moduleReplacements.size === 0) {
|
|
614
|
+
return undefined;
|
|
617
615
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
restorePatchedModuleImports() {
|
|
624
|
-
for (const [module, metadata] of this.originalModuleDefinitions) {
|
|
625
|
-
defineModule(module, metadata);
|
|
616
|
+
const moduleReplacements = new Map(this.options.moduleReplacements);
|
|
617
|
+
for (const [moduleType, replacement] of this.moduleReplacements) {
|
|
618
|
+
moduleReplacements.set(moduleType, replacement);
|
|
626
619
|
}
|
|
627
|
-
|
|
620
|
+
return moduleReplacements;
|
|
628
621
|
}
|
|
629
622
|
}
|
|
630
623
|
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { type ModuleType
|
|
2
|
-
declare module '@fluojs/http' {
|
|
3
|
-
interface FrameworkRequest {
|
|
4
|
-
files?: UploadedFile[];
|
|
5
|
-
rawBody?: Uint8Array;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
import { type ModuleType } from '@fluojs/runtime';
|
|
8
2
|
type AppLike = {
|
|
9
3
|
close(): Promise<void>;
|
|
10
4
|
listen(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-adapter-portability.d.ts","sourceRoot":"","sources":["../../src/portability/http-adapter-portability.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-adapter-portability.d.ts","sourceRoot":"","sources":["../../src/portability/http-adapter-portability.ts"],"names":[],"mappings":"AACA,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAExF,KAAK,OAAO,GAAG;IACb,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB,CAAC;AAcF;;;;;;GAMG;AACH,MAAM,WAAW,oCAAoC,CACnD,iBAAiB,SAAS,MAAM,EAChC,WAAW,SAAS,MAAM,EAC1B,IAAI,SAAS,OAAO,GAAG,OAAO;IAE9B;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,UAAU,EAAE,U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A+CtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mCAAmC,CACjD,iBAAiB,SAAS,MAAM,EAChC,WAAW,SAAS,MAAM,EAC1B,IAAI,SAAS,OAAO,GAAG,OAAO,EAE9B,OAAO,EAAE,oCAAoC,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,CAAC,GAClF,6BAA6B,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,CAAC,CAErE"}
|
|
@@ -3,7 +3,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
5
5
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
6
|
-
import { request as httpsRequest } from 'node:https';
|
|
7
6
|
import { Controller, Get, Post, SseResponse } from '@fluojs/http';
|
|
8
7
|
import { defineModule } from '@fluojs/runtime';
|
|
9
8
|
|
|
@@ -18,6 +17,13 @@ import { defineModule } from '@fluojs/runtime';
|
|
|
18
17
|
function hasListenTarget(value) {
|
|
19
18
|
return typeof value === 'object' && value !== null && 'getListenTarget' in value && typeof value.getListenTarget === 'function';
|
|
20
19
|
}
|
|
20
|
+
function hasRejectedApp(value) {
|
|
21
|
+
if (typeof value !== 'object' || value === null || !('app' in value)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
const app = Reflect.get(value, 'app');
|
|
25
|
+
return typeof app === 'object' && app !== null && 'close' in app && typeof Reflect.get(app, 'close') === 'function' && 'listen' in app && typeof Reflect.get(app, 'listen') === 'function';
|
|
26
|
+
}
|
|
21
27
|
function resolveListeningUrl(app, adapterName) {
|
|
22
28
|
const adapter = Reflect.get(app, 'adapter');
|
|
23
29
|
if (!hasListenTarget(adapter)) {
|
|
@@ -30,6 +36,11 @@ function resolveListeningUrl(app, adapterName) {
|
|
|
30
36
|
return target.url;
|
|
31
37
|
}
|
|
32
38
|
async function requestHttps(url) {
|
|
39
|
+
const [{
|
|
40
|
+
Buffer
|
|
41
|
+
}, {
|
|
42
|
+
request: httpsRequest
|
|
43
|
+
}] = await Promise.all([import('node:buffer'), import('node:https')]);
|
|
33
44
|
return await new Promise((resolve, reject) => {
|
|
34
45
|
const request = httpsRequest(url, {
|
|
35
46
|
rejectUnauthorized: false
|
|
@@ -100,6 +111,21 @@ async function prepareAndListenWithCleanup(app, adapterName, prepare) {
|
|
|
100
111
|
throw setupError;
|
|
101
112
|
}
|
|
102
113
|
}
|
|
114
|
+
async function runApplicationWithRejectedAppCleanup(run, adapterName) {
|
|
115
|
+
try {
|
|
116
|
+
return await run();
|
|
117
|
+
} catch (runError) {
|
|
118
|
+
if (!hasRejectedApp(runError)) {
|
|
119
|
+
throw runError;
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
await runError.app.close();
|
|
123
|
+
} catch (cleanupError) {
|
|
124
|
+
throw new AggregateError([runError, cleanupError], `${adapterName} adapter run() rejected and app.close() also failed during portability harness cleanup.`);
|
|
125
|
+
}
|
|
126
|
+
throw runError;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
103
129
|
|
|
104
130
|
/**
|
|
105
131
|
* A portability harness for testing HTTP adapters to ensure they behave
|
|
@@ -558,12 +584,12 @@ export class HttpAdapterPortabilityHarness {
|
|
|
558
584
|
defineModule(AppModule, {
|
|
559
585
|
controllers: [_HealthController]
|
|
560
586
|
});
|
|
561
|
-
const app = await this.options.run(AppModule, {
|
|
587
|
+
const app = await runApplicationWithRejectedAppCleanup(() => this.options.run(AppModule, {
|
|
562
588
|
cors: false,
|
|
563
589
|
host: '127.0.0.1',
|
|
564
590
|
logger,
|
|
565
591
|
port: 0
|
|
566
|
-
});
|
|
592
|
+
}), this.options.name);
|
|
567
593
|
await runWithListeningUrlCleanup(app, this.options.name, async baseUrl => {
|
|
568
594
|
const response = await fetch(`${baseUrl}/health`);
|
|
569
595
|
if (response.status !== 200) {
|
|
@@ -607,13 +633,13 @@ export class HttpAdapterPortabilityHarness {
|
|
|
607
633
|
defineModule(AppModule, {
|
|
608
634
|
controllers: [_HealthController2]
|
|
609
635
|
});
|
|
610
|
-
const app = await this.options.run(AppModule, {
|
|
636
|
+
const app = await runApplicationWithRejectedAppCleanup(() => this.options.run(AppModule, {
|
|
611
637
|
cors: false,
|
|
612
638
|
host: '127.0.0.1',
|
|
613
639
|
https,
|
|
614
640
|
logger,
|
|
615
641
|
port: 0
|
|
616
|
-
});
|
|
642
|
+
}), this.options.name);
|
|
617
643
|
await runWithListeningUrlCleanup(app, this.options.name, async baseUrl => {
|
|
618
644
|
const response = await requestHttps(`${baseUrl}/health`);
|
|
619
645
|
if (response.statusCode !== 200) {
|
|
@@ -663,12 +689,12 @@ export class HttpAdapterPortabilityHarness {
|
|
|
663
689
|
});
|
|
664
690
|
const signal = 'SIGTERM';
|
|
665
691
|
const listenersBefore = new Set(process.listeners(signal));
|
|
666
|
-
const app = await this.options.run(AppModule, {
|
|
692
|
+
const app = await runApplicationWithRejectedAppCleanup(() => this.options.run(AppModule, {
|
|
667
693
|
cors: false,
|
|
668
694
|
logger,
|
|
669
695
|
port: 0,
|
|
670
696
|
shutdownSignals: [signal]
|
|
671
|
-
});
|
|
697
|
+
}), this.options.name);
|
|
672
698
|
const registeredListeners = process.listeners(signal).filter(listener => !listenersBefore.has(listener));
|
|
673
699
|
await runWithCleanup(app, this.options.name, async () => {
|
|
674
700
|
if (registeredListeners.length === 0) {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { type ModuleType
|
|
2
|
-
declare module '@fluojs/http' {
|
|
3
|
-
interface FrameworkRequest {
|
|
4
|
-
files?: UploadedFile[];
|
|
5
|
-
rawBody?: Uint8Array;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
import { type ModuleType } from '@fluojs/runtime';
|
|
8
2
|
type WebRuntimePortabilityAppLike = {
|
|
9
3
|
close(): Promise<void>;
|
|
10
4
|
dispatch(request: Request): Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-runtime-adapter-portability.d.ts","sourceRoot":"","sources":["../../src/portability/web-runtime-adapter-portability.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"web-runtime-adapter-portability.d.ts","sourceRoot":"","sources":["../../src/portability/web-runtime-adapter-portability.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEhE,KAAK,4BAA4B,GAAG;IAClC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,8CAA8C,CAC7D,iBAAiB,SAAS,MAAM,EAChC,IAAI,SAAS,4BAA4B,GAAG,4BAA4B;IAExE,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,IAAI,EAAE,MAAM,CAAC;CACd;AA0CD;;GAEG;AACH,qBAAa,uCAAuC,CAClD,iBAAiB,SAAS,MAAM,EAChC,IAAI,SAAS,4BAA4B,GAAG,4BAA4B;IAE5D,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,8CAA8C,CAAC,iBAAiB,EAAE,IAAI,CAAC;IAEvG,qCAAqC,IAAI,OAAO,CAAC,IAAI,CAAC;IAyCtD,oCAAoC,IAAI,OAAO,CAAC,IAAI,CAAC;IAgDrD,oCAAoC,IAAI,OAAO,CAAC,IAAI,CAAC;IAsE3D;;OAEG;IACG,wDAAwD,IAAI,OAAO,CAAC,IAAI,CAAC;IA0CzE,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC;IAqDlD,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;CA8ClD;AAED;;;;;GAKG;AACH,wBAAgB,6CAA6C,CAC3D,iBAAiB,SAAS,MAAM,EAChC,IAAI,SAAS,4BAA4B,GAAG,4BAA4B,EAExE,OAAO,EAAE,8CAA8C,CAAC,iBAAiB,EAAE,IAAI,CAAC,GAC/E,uCAAuC,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAElE"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Mock } from 'vitest';
|
|
2
1
|
import type { MaybePromise, Token } from '@fluojs/core';
|
|
3
2
|
import type { ClassType, Container, ForwardRefFn, OptionalToken, Provider } from '@fluojs/di';
|
|
4
|
-
import type { BootstrapApplicationOptions, BootstrapResult, BootstrapModuleOptions, ModuleType } from '@fluojs/runtime';
|
|
5
3
|
import type { Guard, Interceptor } from '@fluojs/http';
|
|
4
|
+
import type { BootstrapApplicationOptions, BootstrapModuleOptions, BootstrapResult, ModuleType } from '@fluojs/runtime';
|
|
6
5
|
import type { RequestBuilder, TestPrincipal, TestRequest, TestRequestWithOptions, TestResponse } from './http.js';
|
|
7
6
|
/**
|
|
8
7
|
* Bootstrap options accepted by `createTestingModule(...)`.
|
|
@@ -74,9 +73,70 @@ export interface TestApp {
|
|
|
74
73
|
close(): Promise<void>;
|
|
75
74
|
}
|
|
76
75
|
/**
|
|
77
|
-
*
|
|
76
|
+
* Result entry recorded by a Vitest-compatible testing mock.
|
|
77
|
+
*/
|
|
78
|
+
export type TestingMockResult<Return> = {
|
|
79
|
+
type: 'return';
|
|
80
|
+
value: Return;
|
|
81
|
+
} | {
|
|
82
|
+
type: 'throw';
|
|
83
|
+
value: unknown;
|
|
84
|
+
} | {
|
|
85
|
+
type: 'incomplete';
|
|
86
|
+
value: undefined;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Settled async result entry recorded by a Vitest-compatible testing mock.
|
|
90
|
+
*/
|
|
91
|
+
export type TestingMockSettledResult<Return> = {
|
|
92
|
+
type: 'fulfilled';
|
|
93
|
+
value: Awaited<Return>;
|
|
94
|
+
} | {
|
|
95
|
+
type: 'rejected';
|
|
96
|
+
value: unknown;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Context snapshot exposed from a Vitest-compatible testing mock.
|
|
100
|
+
*/
|
|
101
|
+
export interface TestingMockContext<Args extends unknown[] = unknown[], Return = unknown> {
|
|
102
|
+
calls: Args[];
|
|
103
|
+
instances: Return[];
|
|
104
|
+
contexts: unknown[];
|
|
105
|
+
invocationCallOrder: number[];
|
|
106
|
+
results: Array<TestingMockResult<Return>>;
|
|
107
|
+
settledResults: Array<TestingMockSettledResult<Return>>;
|
|
108
|
+
lastCall: Args | undefined;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Vitest `Mock<T>`-compatible function shape used to preserve root `DeepMocked<T>` type imports
|
|
112
|
+
* without importing Vitest peer declarations through non-mock entrypoints.
|
|
113
|
+
*/
|
|
114
|
+
export interface TestingMockFunction<Args extends unknown[] = unknown[], Return = unknown> {
|
|
115
|
+
new (...args: Args): Return;
|
|
116
|
+
(...args: Args): Return;
|
|
117
|
+
[Symbol.dispose](): void;
|
|
118
|
+
mock: TestingMockContext<Args, Return>;
|
|
119
|
+
getMockName(): string;
|
|
120
|
+
getMockImplementation(): ((...args: Args) => Return) | undefined;
|
|
121
|
+
mockClear(): this;
|
|
122
|
+
mockName(name: string): this;
|
|
123
|
+
mockReset(): this;
|
|
124
|
+
mockRestore(): void;
|
|
125
|
+
mockImplementation(fn: (...args: Args) => Return): this;
|
|
126
|
+
mockImplementationOnce(fn: (...args: Args) => Return): this;
|
|
127
|
+
withImplementation<T>(fn: (...args: Args) => Return, callback: () => T): T extends Promise<unknown> ? Promise<this> : this;
|
|
128
|
+
mockReturnThis(): this;
|
|
129
|
+
mockReturnValue(value: Return): this;
|
|
130
|
+
mockReturnValueOnce(value: Return): this;
|
|
131
|
+
mockResolvedValue(value: Awaited<Return>): this;
|
|
132
|
+
mockResolvedValueOnce(value: Awaited<Return>): this;
|
|
133
|
+
mockRejectedValue(error: unknown): this;
|
|
134
|
+
mockRejectedValueOnce(error: unknown): this;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Shallow method-mocked version of a type where function properties become mock functions.
|
|
78
138
|
*/
|
|
79
139
|
export type DeepMocked<T> = {
|
|
80
|
-
[K in keyof T]: T[K] extends (...args: infer A) => infer R ?
|
|
140
|
+
[K in keyof T]: T[K] extends (...args: infer A) => infer R ? TestingMockFunction<A, R> & T[K] : T[K];
|
|
81
141
|
};
|
|
82
142
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxH,OAAO,KAAK,EAAE,cAAc,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AG,IAAI,CAAC;IAChD,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACpD,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACxC,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;KACzB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrG,CAAC"}
|
package/dist/vitest/tooling.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Collects
|
|
2
|
+
* Collects package-export aliases for a fluo monorepo checkout.
|
|
3
3
|
*
|
|
4
4
|
* @param repoRootUrl - Repository root as a file URL or absolute path URL string.
|
|
5
|
-
* @returns A Vite/Vitest alias map that points
|
|
5
|
+
* @returns A Vite/Vitest alias map that points exported package imports at workspace source files.
|
|
6
6
|
*/
|
|
7
7
|
export declare function collectWorkspaceAliases(repoRootUrl: string | URL): Record<string, string>;
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooling.d.ts","sourceRoot":"","sources":["../../src/vitest/tooling.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooling.d.ts","sourceRoot":"","sources":["../../src/vitest/tooling.ts"],"names":[],"mappings":"AAmJA;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYzF;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,EAAE,SAAS,KAAK,uBAaxF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,wBAErC"}
|