@danceroutine/tango-testing 1.11.1 → 1.11.2

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 (90) hide show
  1. package/dist/{aDBClient-CH-ZcOaP.js → aDBClient-fMkIdR7p.js} +16 -7
  2. package/dist/aDBClient-fMkIdR7p.js.map +1 -0
  3. package/dist/assertions/index.d.ts +2 -4
  4. package/dist/assertions/index.js +2 -3
  5. package/dist/assertions-lsAd7fhA.js +15 -0
  6. package/dist/assertions-lsAd7fhA.js.map +1 -0
  7. package/dist/chunk-D7D4PA-g.js +13 -0
  8. package/dist/express/index.d.ts +2 -3
  9. package/dist/express/index.js +2 -3
  10. package/dist/{express-Czpfz_Ay.js → express-CH6_GAyC.js} +23 -15
  11. package/dist/express-CH6_GAyC.js.map +1 -0
  12. package/dist/factories/index.d.ts +2 -4
  13. package/dist/factories/index.js +2 -3
  14. package/dist/{factories-Cl_CAzbj.js → factories-qAJouv1I.js} +10 -8
  15. package/dist/factories-qAJouv1I.js.map +1 -0
  16. package/dist/index-49XmDOxW.d.ts +40 -0
  17. package/dist/index-B4H3wYuR.d.ts +325 -0
  18. package/dist/index-BCWo7zAn.d.ts +41 -0
  19. package/dist/index-CKVKW5j_.d.ts +15 -0
  20. package/dist/index-CnUPgs3G.d.ts +208 -0
  21. package/dist/index.d.ts +7 -19
  22. package/dist/index.js +8 -9
  23. package/dist/integration/index.d.ts +2 -18
  24. package/dist/integration/index.js +2 -4
  25. package/dist/{integration-CaRF_lF_.js → integration-CLzkacon.js} +99 -84
  26. package/dist/integration-CLzkacon.js.map +1 -0
  27. package/dist/mocks/index.d.ts +2 -20
  28. package/dist/mocks/index.js +3 -4
  29. package/dist/{mocks-BL_0iuAI.js → mocks-JyZwO-W4.js} +77 -65
  30. package/dist/mocks-JyZwO-W4.js.map +1 -0
  31. package/dist/vitest/index.d.ts +60 -3
  32. package/dist/vitest/index.js +119 -4
  33. package/dist/vitest/index.js.map +1 -0
  34. package/package.json +7 -7
  35. package/dist/aDBClient-CH-ZcOaP.js.map +0 -1
  36. package/dist/assertions/assertions.d.ts +0 -7
  37. package/dist/assertions-CCFZ53Y-.js +0 -15
  38. package/dist/assertions-CCFZ53Y-.js.map +0 -1
  39. package/dist/chunk-BkvOhyD0.js +0 -12
  40. package/dist/express/anExpressRequest.d.ts +0 -24
  41. package/dist/express/anExpressResponse.d.ts +0 -9
  42. package/dist/express-Czpfz_Ay.js.map +0 -1
  43. package/dist/factories/ModelDataFactory.d.ts +0 -33
  44. package/dist/factories-Cl_CAzbj.js.map +0 -1
  45. package/dist/integration/HarnessStrategyRegistry.d.ts +0 -25
  46. package/dist/integration/TestHarness.d.ts +0 -38
  47. package/dist/integration/anIntegrationHarness.d.ts +0 -5
  48. package/dist/integration/config.d.ts +0 -11
  49. package/dist/integration/conformance/index.d.ts +0 -1
  50. package/dist/integration/conformance/runDialectConformanceSuite.d.ts +0 -11
  51. package/dist/integration/domain/Dialect.d.ts +0 -5
  52. package/dist/integration/domain/HarnessStrategy.d.ts +0 -17
  53. package/dist/integration/domain/IntegrationHarness.d.ts +0 -22
  54. package/dist/integration/domain/ResetMode.d.ts +0 -6
  55. package/dist/integration/domain/index.d.ts +0 -7
  56. package/dist/integration/migrations/ApplyAndVerifyMigrations.d.ts +0 -16
  57. package/dist/integration/migrations/AssertMigrationPlan.d.ts +0 -9
  58. package/dist/integration/migrations/IntrospectSchema.d.ts +0 -5
  59. package/dist/integration/migrations/index.d.ts +0 -6
  60. package/dist/integration/orm/createModelQuerySetFixture.d.ts +0 -10
  61. package/dist/integration/orm/createQuerySetFixture.d.ts +0 -10
  62. package/dist/integration/orm/expectQueryResult.d.ts +0 -4
  63. package/dist/integration/orm/index.d.ts +0 -7
  64. package/dist/integration/orm/seedTable.d.ts +0 -5
  65. package/dist/integration/runtime/aTangoConfig.d.ts +0 -9
  66. package/dist/integration/runtime/aTangoRuntime.d.ts +0 -6
  67. package/dist/integration/runtime/index.d.ts +0 -7
  68. package/dist/integration/runtime/setupTestTangoRuntime.d.ts +0 -6
  69. package/dist/integration/smoke/AppProcessHarness.d.ts +0 -83
  70. package/dist/integration/smoke/index.d.ts +0 -4
  71. package/dist/integration/strategies/PostgresHarnessStrategy.d.ts +0 -19
  72. package/dist/integration/strategies/SqliteHarnessStrategy.d.ts +0 -19
  73. package/dist/integration-CaRF_lF_.js.map +0 -1
  74. package/dist/mocks/DBClient.d.ts +0 -1
  75. package/dist/mocks/MockQuerySetResult.d.ts +0 -6
  76. package/dist/mocks/aDBClient.d.ts +0 -24
  77. package/dist/mocks/aManager.d.ts +0 -20
  78. package/dist/mocks/aManyToManyRelatedManager.d.ts +0 -52
  79. package/dist/mocks/aModelQuerySet.d.ts +0 -8
  80. package/dist/mocks/aQueryExecutor.d.ts +0 -16
  81. package/dist/mocks/aQueryResult.d.ts +0 -9
  82. package/dist/mocks/aQuerySet.d.ts +0 -5
  83. package/dist/mocks/aRelationMeta.d.ts +0 -20
  84. package/dist/mocks/aRequestContext.d.ts +0 -22
  85. package/dist/mocks/anAdapter.d.ts +0 -13
  86. package/dist/mocks-BL_0iuAI.js.map +0 -1
  87. package/dist/vitest/registerVitestTango.d.ts +0 -46
  88. package/dist/vitest/withGlobalTestApi.d.ts +0 -7
  89. package/dist/vitest-BqZmULOa.js +0 -111
  90. package/dist/vitest-BqZmULOa.js.map +0 -1
@@ -1,24 +0,0 @@
1
- import type { Request } from 'express';
2
- type ExpressRequestParams = Request['params'] | Record<string, string | string[]>;
3
- /**
4
- * Overrides accepted by `anExpressRequest`. All fields are optional;
5
- * sensible defaults are provided for a minimal GET request.
6
- */
7
- export type ExpressRequestOverrides = {
8
- protocol?: string;
9
- method?: string;
10
- originalUrl?: string;
11
- url?: string;
12
- headers?: Record<string, any>;
13
- body?: any;
14
- params?: ExpressRequestParams;
15
- get?: (name: string) => string | undefined;
16
- };
17
- /**
18
- * Create a minimal Express `Request` test double.
19
- * The `get` method is a Vitest mock that returns `'localhost:3000'` for the
20
- * `host` header and `undefined` for everything else, matching the most common
21
- * test pattern. Override any field via the `overrides` argument.
22
- */
23
- export declare function anExpressRequest(overrides?: ExpressRequestOverrides): Request;
24
- export {};
@@ -1,9 +0,0 @@
1
- import type { Response } from 'express';
2
- /**
3
- * Create an Express `Response` test double.
4
- *
5
- * Every Express `Response` method is backed by a `vi.fn()`.
6
- * Chainable methods (`status`, `sendStatus`, `links`, etc.) return `res`.
7
- * Use `vi.mocked()` to access the mock API for assertions.
8
- */
9
- export declare function anExpressResponse(): Response;
@@ -1 +0,0 @@
1
- {"version":3,"file":"express-Czpfz_Ay.js","names":["overrides: ExpressRequestOverrides","name: string","res: Record<string, unknown>"],"sources":["../src/express/anExpressRequest.ts","../src/express/anExpressResponse.ts","../src/express/index.ts"],"sourcesContent":["import { vi } from 'vitest';\nimport type { Request } from 'express';\n\ntype ExpressRequestParams = Request['params'] | Record<string, string | string[]>;\n\n/**\n * Overrides accepted by `anExpressRequest`. All fields are optional;\n * sensible defaults are provided for a minimal GET request.\n */\nexport type ExpressRequestOverrides = {\n protocol?: string;\n method?: string;\n originalUrl?: string;\n url?: string;\n // oxlint-disable-next-line typescript/no-explicit-any\n headers?: Record<string, any>;\n // oxlint-disable-next-line typescript/no-explicit-any\n body?: any;\n params?: ExpressRequestParams;\n get?: (name: string) => string | undefined;\n};\n\n/**\n * Create a minimal Express `Request` test double.\n * The `get` method is a Vitest mock that returns `'localhost:3000'` for the\n * `host` header and `undefined` for everything else, matching the most common\n * test pattern. Override any field via the `overrides` argument.\n */\nexport function anExpressRequest(overrides: ExpressRequestOverrides = {}): Request {\n return {\n protocol: 'http',\n method: 'GET',\n originalUrl: '/',\n url: '/',\n headers: {},\n body: undefined,\n params: {},\n get: vi.fn((name: string) => (name.toLowerCase() === 'host' ? 'localhost:3000' : undefined)),\n ...overrides,\n } as unknown as Request;\n}\n","import { vi } from 'vitest';\nimport type { Response } from 'express';\n\n/**\n * Create an Express `Response` test double.\n *\n * Every Express `Response` method is backed by a `vi.fn()`.\n * Chainable methods (`status`, `sendStatus`, `links`, etc.) return `res`.\n * Use `vi.mocked()` to access the mock API for assertions.\n */\nexport function anExpressResponse(): Response {\n const res: Record<string, unknown> = {};\n\n const chainable = [\n 'status',\n 'sendStatus',\n 'links',\n 'contentType',\n 'type',\n 'format',\n 'attachment',\n 'set',\n 'header',\n 'clearCookie',\n 'cookie',\n 'location',\n 'vary',\n 'append',\n ];\n\n for (const method of chainable) {\n res[method] = vi.fn().mockReturnValue(res);\n }\n\n res.send = vi.fn().mockReturnValue(res);\n res.json = vi.fn().mockReturnValue(res);\n res.jsonp = vi.fn().mockReturnValue(res);\n res.end = vi.fn().mockReturnValue(res);\n res.sendFile = vi.fn();\n res.download = vi.fn();\n res.redirect = vi.fn();\n res.render = vi.fn();\n res.get = vi.fn();\n res.setHeader = vi.fn().mockReturnValue(res);\n\n res.headersSent = false;\n res.locals = {};\n res.charset = 'utf-8';\n res.app = {};\n res.req = {};\n\n return res as unknown as Response;\n}\n","export { anExpressRequest } from './anExpressRequest';\nexport type { ExpressRequestOverrides } from './anExpressRequest';\nexport { anExpressResponse } from './anExpressResponse';\n"],"mappings":";;;;AA4BO,SAAS,iBAAiBA,YAAqC,CAAE,GAAW;AAC/E,QAAO;EACH,UAAU;EACV,QAAQ;EACR,aAAa;EACb,KAAK;EACL,SAAS,CAAE;EACX,MAAM;EACN,QAAQ,CAAE;EACV,KAAK,KAAG,GAAG,CAACC,SAAkB,KAAK,aAAa,KAAK,SAAS,mBAAmB,UAAW;EAC5F,GAAG;CACN;AACJ;;;;AC9BM,SAAS,oBAA8B;CAC1C,MAAMC,MAA+B,CAAE;CAEvC,MAAM,YAAY;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACH;AAED,MAAK,MAAM,UAAU,UACjB,KAAI,UAAU,GAAG,IAAI,CAAC,gBAAgB,IAAI;AAG9C,KAAI,OAAO,GAAG,IAAI,CAAC,gBAAgB,IAAI;AACvC,KAAI,OAAO,GAAG,IAAI,CAAC,gBAAgB,IAAI;AACvC,KAAI,QAAQ,GAAG,IAAI,CAAC,gBAAgB,IAAI;AACxC,KAAI,MAAM,GAAG,IAAI,CAAC,gBAAgB,IAAI;AACtC,KAAI,WAAW,GAAG,IAAI;AACtB,KAAI,WAAW,GAAG,IAAI;AACtB,KAAI,WAAW,GAAG,IAAI;AACtB,KAAI,SAAS,GAAG,IAAI;AACpB,KAAI,MAAM,GAAG,IAAI;AACjB,KAAI,YAAY,GAAG,IAAI,CAAC,gBAAgB,IAAI;AAE5C,KAAI,cAAc;AAClB,KAAI,SAAS,CAAE;AACf,KAAI,UAAU;AACd,KAAI,MAAM,CAAE;AACZ,KAAI,MAAM,CAAE;AAEZ,QAAO;AACV"}
@@ -1,33 +0,0 @@
1
- export type GenericModelFactory<TInput extends Record<string, unknown> = Record<string, unknown>, TOutput = TInput> = {
2
- create(data: TInput): TOutput;
3
- parse(data: unknown): TOutput;
4
- };
5
- /**
6
- * Factory class for generating test data with sequences and defaults.
7
- */
8
- export declare class ModelDataFactory<TModel extends GenericModelFactory<Record<string, unknown>, unknown>> {
9
- private model;
10
- private defaults;
11
- private sequence;
12
- constructor(model: TModel, defaults?: Partial<Parameters<TModel['create']>[0]>);
13
- /**
14
- * Build one model instance by merging defaults, sequence defaults, and overrides.
15
- */
16
- build(overrides?: Partial<Parameters<TModel['create']>[0]>): ReturnType<TModel['create']>;
17
- /**
18
- * Build `count` model instances using shared overrides.
19
- */
20
- buildList(count: number, overrides?: Partial<Parameters<TModel['create']>[0]>): ReturnType<TModel['create']>[];
21
- /**
22
- * Reset the internal sequence counter to zero.
23
- */
24
- resetSequence(): void;
25
- /**
26
- * Return the current sequence counter value.
27
- */
28
- getSequence(): number;
29
- /**
30
- * Hook for subclasses to provide per-sequence default values.
31
- */
32
- protected sequenceDefaults(): Partial<Parameters<TModel['create']>[0]>;
33
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"factories-Cl_CAzbj.js","names":["model: TModel","defaults: Partial<Parameters<TModel['create']>[0]>","overrides: Partial<Parameters<TModel['create']>[0]>","count: number"],"sources":["../src/factories/ModelDataFactory.ts","../src/factories/index.ts"],"sourcesContent":["export type GenericModelFactory<TInput extends Record<string, unknown> = Record<string, unknown>, TOutput = TInput> = {\n create(data: TInput): TOutput;\n parse(data: unknown): TOutput;\n};\n\n/**\n * Factory class for generating test data with sequences and defaults.\n */\nexport class ModelDataFactory<TModel extends GenericModelFactory<Record<string, unknown>, unknown>> {\n private sequence = 0;\n\n constructor(\n private model: TModel,\n private defaults: Partial<Parameters<TModel['create']>[0]> = {}\n ) {}\n\n /**\n * Build one model instance by merging defaults, sequence defaults, and overrides.\n */\n public build(overrides: Partial<Parameters<TModel['create']>[0]> = {}): ReturnType<TModel['create']> {\n this.sequence++;\n const data = {\n ...this.defaults,\n ...this.sequenceDefaults(),\n ...overrides,\n };\n return this.model.create(data as Parameters<TModel['create']>[0]) as ReturnType<TModel['create']>;\n }\n\n /**\n * Build `count` model instances using shared overrides.\n */\n public buildList(\n count: number,\n overrides: Partial<Parameters<TModel['create']>[0]> = {}\n ): ReturnType<TModel['create']>[] {\n return Array.from({ length: count }, () => this.build(overrides));\n }\n\n /**\n * Reset the internal sequence counter to zero.\n */\n public resetSequence(): void {\n this.sequence = 0;\n }\n\n /**\n * Return the current sequence counter value.\n */\n public getSequence(): number {\n return this.sequence;\n }\n\n /**\n * Hook for subclasses to provide per-sequence default values.\n */\n protected sequenceDefaults(): Partial<Parameters<TModel['create']>[0]> {\n return {};\n }\n}\n","/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport { ModelDataFactory, type GenericModelFactory } from './ModelDataFactory';\n"],"mappings":";;;IAQa,mBAAN,MAA6F;CAChG,WAAmB;CAEnB,YACYA,OACAC,WAAqD,CAAE,GACjE;AAAA,OAFU,QAAA;AAAA,OACA,WAAA;CACR;;;;CAKJ,MAAaC,YAAsD,CAAE,GAAgC;AACjG,OAAK;EACL,MAAM,OAAO;GACT,GAAG,KAAK;GACR,GAAG,KAAK,kBAAkB;GAC1B,GAAG;EACN;AACD,SAAO,KAAK,MAAM,OAAO,KAAwC;CACpE;;;;CAKD,UACIC,OACAD,YAAsD,CAAE,GAC1B;AAC9B,SAAO,MAAM,KAAK,EAAE,QAAQ,MAAO,GAAE,MAAM,KAAK,MAAM,UAAU,CAAC;CACpE;;;;CAKD,gBAA6B;AACzB,OAAK,WAAW;CACnB;;;;CAKD,cAA6B;AACzB,SAAO,KAAK;CACf;;;;CAKD,mBAAuE;AACnE,SAAO,CAAE;CACZ;AACJ"}
@@ -1,25 +0,0 @@
1
- import type { Dialect, HarnessStrategy } from './domain';
2
- /**
3
- * Registry of test harness strategies keyed by dialect.
4
- */
5
- export declare class HarnessStrategyRegistry {
6
- static readonly BRAND: "tango.testing.harness_strategy_registry";
7
- readonly __tangoBrand: typeof HarnessStrategyRegistry.BRAND;
8
- private readonly strategies;
9
- /**
10
- * Narrow an unknown value to `HarnessStrategyRegistry`.
11
- */
12
- static isHarnessStrategyRegistry(value: unknown): value is HarnessStrategyRegistry;
13
- /**
14
- * Register or replace a dialect strategy.
15
- */
16
- register(strategy: HarnessStrategy): this;
17
- /**
18
- * Resolve a strategy for a dialect, or throw if none is registered.
19
- */
20
- get(dialect: Dialect | string): HarnessStrategy;
21
- /**
22
- * List all registered strategies.
23
- */
24
- list(): readonly HarnessStrategy[];
25
- }
@@ -1,38 +0,0 @@
1
- import { HarnessStrategyRegistry } from './HarnessStrategyRegistry';
2
- import { Dialect, type HarnessOptions, type HarnessStrategy, type IntegrationHarness } from './domain';
3
- /**
4
- * Facade for creating integration test harnesses by dialect.
5
- */
6
- export declare class TestHarness {
7
- static readonly BRAND: "tango.testing.test_harness";
8
- private static defaultRegistry;
9
- readonly __tangoBrand: typeof TestHarness.BRAND;
10
- /**
11
- * Narrow an unknown value to `TestHarness`.
12
- */
13
- static isTestHarness(value: unknown): value is TestHarness;
14
- /**
15
- * Register a harness strategy on the shared default registry.
16
- */
17
- static registerStrategy(strategy: HarnessStrategy): void;
18
- /**
19
- * Return the shared harness strategy registry.
20
- */
21
- static getRegistry(): HarnessStrategyRegistry;
22
- /**
23
- * Create a dialect-specific harness from the registry.
24
- */
25
- static forDialect(args: {
26
- dialect: Dialect | string;
27
- options?: HarnessOptions;
28
- }, registry?: HarnessStrategyRegistry): Promise<IntegrationHarness>;
29
- /**
30
- * Convenience helper for a SQLite test harness.
31
- */
32
- static sqlite(options?: HarnessOptions): Promise<IntegrationHarness>;
33
- /**
34
- * Convenience helper for a Postgres test harness.
35
- */
36
- static postgres(options?: HarnessOptions): Promise<IntegrationHarness>;
37
- private static ensureRegistry;
38
- }
@@ -1,5 +0,0 @@
1
- import type { IntegrationHarness } from './domain/IntegrationHarness';
2
- /**
3
- * Create an integration-harness fixture with optional overrides.
4
- */
5
- export declare function anIntegrationHarness(overrides?: Partial<IntegrationHarness>): IntegrationHarness;
@@ -1,11 +0,0 @@
1
- import type { AdapterConfig } from '@danceroutine/tango-orm';
2
- import { Dialect } from './domain';
3
- /**
4
- * Resolve adapter configuration for a test harness from explicit options,
5
- * typed Tango config, and environment variables in that order.
6
- */
7
- export declare function resolveAdapterConfig(dialect: Dialect, opts: {
8
- config?: Partial<AdapterConfig>;
9
- tangoConfigLoader?: () => unknown;
10
- sqliteFile?: string;
11
- }): AdapterConfig;
@@ -1 +0,0 @@
1
- export { runDialectConformanceSuite } from './runDialectConformanceSuite';
@@ -1,11 +0,0 @@
1
- import type { HarnessOptions, HarnessStrategy } from '../domain';
2
- /**
3
- * Shared conformance checks every harness strategy must satisfy.
4
- *
5
- * This is intentionally framework-agnostic so first-party and third-party
6
- * strategies can run the same lifecycle validation.
7
- */
8
- export declare function runDialectConformanceSuite(strategy: HarnessStrategy, options?: {
9
- createOptions?: HarnessOptions;
10
- migrationsDir?: string;
11
- }): Promise<void>;
@@ -1,5 +0,0 @@
1
- export declare const Dialect: {
2
- readonly Sqlite: "sqlite";
3
- readonly Postgres: "postgres";
4
- };
5
- export type Dialect = (typeof Dialect)[keyof typeof Dialect];
@@ -1,17 +0,0 @@
1
- import type { Dialect } from './Dialect';
2
- import type { AdapterConfig } from '@danceroutine/tango-orm';
3
- import type { DialectTestCapabilities } from './IntegrationHarness';
4
- import type { IntegrationHarness } from './IntegrationHarness';
5
- import type { ResetMode } from './ResetMode';
6
- export interface HarnessOptions {
7
- config?: Partial<AdapterConfig>;
8
- tangoConfigLoader?: () => unknown;
9
- resetMode?: ResetMode;
10
- schema?: string;
11
- sqliteFile?: string;
12
- }
13
- export interface HarnessStrategy {
14
- readonly dialect: Dialect | string;
15
- readonly capabilities: DialectTestCapabilities;
16
- create(options?: HarnessOptions): Promise<IntegrationHarness>;
17
- }
@@ -1,22 +0,0 @@
1
- import type { Adapter, DBClient } from '@danceroutine/tango-orm';
2
- import type { MigrationRunner } from '@danceroutine/tango-migrations';
3
- import type { Dialect } from './Dialect';
4
- import type { ResetMode } from './ResetMode';
5
- export interface DialectTestCapabilities {
6
- transactionalDDL: boolean;
7
- supportsSchemas: boolean;
8
- supportsConcurrentIndex: boolean;
9
- supportsDeferredFkValidation: boolean;
10
- supportsJsonb: boolean;
11
- }
12
- export interface IntegrationHarness {
13
- readonly dialect: Dialect | string;
14
- readonly adapter: Adapter;
15
- readonly capabilities: DialectTestCapabilities;
16
- readonly resetMode: ResetMode;
17
- readonly dbClient: DBClient;
18
- setup(): Promise<void>;
19
- reset(): Promise<void>;
20
- teardown(): Promise<void>;
21
- migrationRunner(migrationsDir: string): MigrationRunner;
22
- }
@@ -1,6 +0,0 @@
1
- export declare const ResetMode: {
2
- readonly Transaction: "transaction";
3
- readonly Truncate: "truncate";
4
- readonly DropSchema: "drop-schema";
5
- };
6
- export type ResetMode = (typeof ResetMode)[keyof typeof ResetMode];
@@ -1,7 +0,0 @@
1
- /**
2
- * Domain boundary barrel: centralizes this subdomain's public contract.
3
- */
4
- export { Dialect } from './Dialect';
5
- export type { HarnessOptions, HarnessStrategy } from './HarnessStrategy';
6
- export type { DialectTestCapabilities, IntegrationHarness } from './IntegrationHarness';
7
- export { ResetMode } from './ResetMode';
@@ -1,16 +0,0 @@
1
- import type { IntegrationHarness } from '../domain';
2
- export type ApplyAndVerifyMigrationsOptions = {
3
- migrationsDir: string;
4
- toId?: string;
5
- expectedAppliedIds?: string[];
6
- };
7
- export type MigrationStatus = {
8
- id: string;
9
- applied: boolean;
10
- };
11
- /**
12
- * Apply migrations through a harness and optionally verify that specific ids were applied.
13
- */
14
- export declare function applyAndVerifyMigrations(harness: IntegrationHarness, options: ApplyAndVerifyMigrationsOptions): Promise<{
15
- statuses: MigrationStatus[];
16
- }>;
@@ -1,9 +0,0 @@
1
- import type { IntegrationHarness } from '../domain';
2
- export type AssertMigrationPlanOptions = {
3
- migrationsDir: string;
4
- expectSqlContains?: string[];
5
- };
6
- /**
7
- * Generate a migration plan through a harness and assert that required SQL fragments appear.
8
- */
9
- export declare function assertMigrationPlan(harness: IntegrationHarness, options: AssertMigrationPlanOptions): Promise<string>;
@@ -1,5 +0,0 @@
1
- import { type IntegrationHarness } from '../domain';
2
- /**
3
- * Introspect the schema visible to a harness using Tango's built-in introspectors.
4
- */
5
- export declare function introspectSchema(harness: IntegrationHarness): Promise<unknown>;
@@ -1,6 +0,0 @@
1
- /**
2
- * Domain boundary barrel: centralizes this subdomain's public contract.
3
- */
4
- export { assertMigrationPlan, type AssertMigrationPlanOptions } from './AssertMigrationPlan';
5
- export { applyAndVerifyMigrations, type ApplyAndVerifyMigrationsOptions, type MigrationStatus, } from './ApplyAndVerifyMigrations';
6
- export { introspectSchema } from './IntrospectSchema';
@@ -1,10 +0,0 @@
1
- import { QuerySet } from '@danceroutine/tango-orm';
2
- import type { TableMeta } from '@danceroutine/tango-orm/query';
3
- import type { IntegrationHarness } from '../domain/index';
4
- /**
5
- * Create a `ModelQuerySet` fixture backed by a real integration harness and supplied table metadata.
6
- */
7
- export declare function createModelQuerySetFixture<TModel extends Record<string, unknown>>(input: {
8
- harness: IntegrationHarness;
9
- meta: TableMeta;
10
- }): QuerySet<TModel>;
@@ -1,10 +0,0 @@
1
- import type { QuerySet } from '@danceroutine/tango-orm';
2
- import type { TableMeta } from '@danceroutine/tango-orm/query';
3
- import type { IntegrationHarness } from '../domain/index';
4
- /**
5
- * @deprecated Use `createModelQuerySetFixture(...)` instead.
6
- */
7
- export declare function createQuerySetFixture<TModel extends Record<string, unknown>>(input: {
8
- harness: IntegrationHarness;
9
- meta: TableMeta;
10
- }): QuerySet<TModel>;
@@ -1,4 +0,0 @@
1
- /**
2
- * Assert that a query result matches an expected value using structural equality.
3
- */
4
- export declare function expectQueryResult<T>(actual: Promise<T> | T, expected: T): Promise<void>;
@@ -1,7 +0,0 @@
1
- /**
2
- * Domain boundary barrel: centralizes this subdomain's public contract.
3
- */
4
- export { seedTable } from './seedTable';
5
- export { createModelQuerySetFixture } from './createModelQuerySetFixture';
6
- export { createQuerySetFixture } from './createQuerySetFixture';
7
- export { expectQueryResult } from './expectQueryResult';
@@ -1,5 +0,0 @@
1
- import { type IntegrationHarness } from '../domain/index';
2
- /**
3
- * Seed rows directly into a table for integration tests that need known fixtures.
4
- */
5
- export declare function seedTable<T extends Record<string, unknown>>(harness: IntegrationHarness, table: string, rows: T[]): Promise<void>;
@@ -1,9 +0,0 @@
1
- import { type TangoConfig } from '@danceroutine/tango-config';
2
- export type TestTangoConfigOptions = {
3
- adapter?: 'sqlite' | 'postgres';
4
- sqliteFilename?: string;
5
- };
6
- /**
7
- * Create a stable Tango config fixture for runtime-oriented tests.
8
- */
9
- export declare function aTangoConfig(options?: TestTangoConfigOptions): TangoConfig;
@@ -1,6 +0,0 @@
1
- import { TangoRuntime } from '@danceroutine/tango-orm';
2
- import { type TestTangoConfigOptions } from './aTangoConfig';
3
- /**
4
- * Create a standalone Tango runtime for tests without mutating the process-default runtime.
5
- */
6
- export declare function aTangoRuntime(options?: TestTangoConfigOptions): TangoRuntime;
@@ -1,7 +0,0 @@
1
- /**
2
- * Domain boundary barrel: centralizes runtime-oriented integration fixtures.
3
- */
4
- export { aTangoConfig } from './aTangoConfig';
5
- export type { TestTangoConfigOptions } from './aTangoConfig';
6
- export { aTangoRuntime } from './aTangoRuntime';
7
- export { setupTestTangoRuntime } from './setupTestTangoRuntime';
@@ -1,6 +0,0 @@
1
- import { type TangoRuntime } from '@danceroutine/tango-orm';
2
- import { type TestTangoConfigOptions } from './aTangoConfig';
3
- /**
4
- * Reset and initialize the process-default Tango runtime for tests.
5
- */
6
- export declare function setupTestTangoRuntime(options?: TestTangoConfigOptions): Promise<TangoRuntime>;
@@ -1,83 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- export interface AppProcessHarnessOptions {
3
- command: string;
4
- args?: string[];
5
- cwd?: string;
6
- env?: Record<string, string | undefined>;
7
- baseUrl: string;
8
- readyPath?: string;
9
- readyTimeoutMs?: number;
10
- readyIntervalMs?: number;
11
- stopTimeoutMs?: number;
12
- }
13
- type FetchLike = typeof fetch;
14
- type ProcessHarnessOutputStream = {
15
- on(eventName: 'data', listener: (chunk: unknown) => void): unknown;
16
- };
17
- type ProcessHarnessChild = {
18
- exitCode: number | null;
19
- killed: boolean;
20
- kill(signal?: NodeJS.Signals): boolean;
21
- off(eventName: 'exit', listener: () => void): unknown;
22
- once(eventName: 'exit', listener: () => void): unknown;
23
- stdout?: ProcessHarnessOutputStream | null;
24
- stderr?: ProcessHarnessOutputStream | null;
25
- };
26
- interface AppProcessHarnessDeps {
27
- spawnProcess: (command: string, args?: readonly string[], options?: Parameters<typeof spawn>[2]) => ProcessHarnessChild;
28
- fetchImpl: FetchLike;
29
- sleep: (ms: number) => Promise<void>;
30
- }
31
- /**
32
- * Lightweight process harness for end-to-end smoke tests that need a real app process.
33
- */
34
- export declare class AppProcessHarness {
35
- static readonly BRAND: "tango.testing.app_process_harness";
36
- readonly __tangoBrand: typeof AppProcessHarness.BRAND;
37
- private readonly child;
38
- private readonly baseUrl;
39
- private readonly readyUrl;
40
- private readonly readyTimeoutMs;
41
- private readonly readyIntervalMs;
42
- private readonly stopTimeoutMs;
43
- private readonly deps;
44
- private stopped;
45
- private stdoutBuffer;
46
- private stderrBuffer;
47
- private constructor();
48
- /**
49
- * Narrow an unknown value to the smoke-test harness that owns a child process.
50
- */
51
- static isAppProcessHarness(value: unknown): value is AppProcessHarness;
52
- /**
53
- * Spawn the target process and wait until its readiness endpoint responds successfully.
54
- */
55
- static start(options: AppProcessHarnessOptions, deps?: Partial<AppProcessHarnessDeps>): Promise<AppProcessHarness>;
56
- /**
57
- * Return the buffered stdout log for recent process output.
58
- */
59
- getStdoutLog(): string;
60
- /**
61
- * Return the buffered stderr log for recent process output.
62
- */
63
- getStderrLog(): string;
64
- /**
65
- * Return stdout and stderr in a single formatted string for debugging failures.
66
- */
67
- getCombinedLog(): string;
68
- /**
69
- * Issue an HTTP request against the managed application process.
70
- */
71
- request(path: string, init?: RequestInit): Promise<Response>;
72
- /**
73
- * Assert an HTTP response status and include process logs when it mismatches.
74
- */
75
- assertResponseStatus(response: Response, expectedStatus: number, label: string): Promise<void>;
76
- /**
77
- * Stop the managed process, escalating from SIGTERM to SIGKILL when necessary.
78
- */
79
- stop(): Promise<void>;
80
- private waitForReady;
81
- private waitForExit;
82
- }
83
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Domain boundary barrel: centralizes this subdomain's public contract.
3
- */
4
- export * from './AppProcessHarness';
@@ -1,19 +0,0 @@
1
- import { Dialect, type DialectTestCapabilities, type HarnessOptions, type HarnessStrategy, type IntegrationHarness } from '../domain';
2
- /**
3
- * Harness strategy for PostgreSQL-backed integration tests.
4
- */
5
- export declare class PostgresHarnessStrategy implements HarnessStrategy {
6
- static readonly BRAND: "tango.testing.postgres_harness_strategy";
7
- readonly __tangoBrand: typeof PostgresHarnessStrategy.BRAND;
8
- readonly dialect: Dialect;
9
- readonly capabilities: DialectTestCapabilities;
10
- /**
11
- * Narrow an unknown value to the PostgreSQL integration harness strategy.
12
- */
13
- static isPostgresHarnessStrategy(value: unknown): value is PostgresHarnessStrategy;
14
- private static buildSchemaName;
15
- /**
16
- * Create a configured Postgres integration harness instance.
17
- */
18
- create(options?: HarnessOptions): Promise<IntegrationHarness>;
19
- }
@@ -1,19 +0,0 @@
1
- import { Dialect, type DialectTestCapabilities, type HarnessOptions, type HarnessStrategy, type IntegrationHarness } from '../domain';
2
- /**
3
- * Harness strategy for SQLite-backed integration tests.
4
- */
5
- export declare class SqliteHarnessStrategy implements HarnessStrategy {
6
- static readonly BRAND: "tango.testing.sqlite_harness_strategy";
7
- readonly __tangoBrand: typeof SqliteHarnessStrategy.BRAND;
8
- readonly dialect: Dialect;
9
- readonly capabilities: DialectTestCapabilities;
10
- /**
11
- * Narrow an unknown value to the SQLite integration harness strategy.
12
- */
13
- static isSqliteHarnessStrategy(value: unknown): value is SqliteHarnessStrategy;
14
- private static dropAllTables;
15
- /**
16
- * Create a configured SQLite integration harness instance.
17
- */
18
- create(options?: HarnessOptions): Promise<IntegrationHarness>;
19
- }