@entifix/testing-unit 0.13.0 → 0.14.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/dist/contracts/index.d.ts +2 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +2 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/push-channel.contract.d.ts +45 -0
- package/dist/contracts/push-channel.contract.d.ts.map +1 -0
- package/dist/contracts/push-channel.contract.js +135 -0
- package/dist/contracts/push-channel.contract.js.map +1 -0
- package/dist/contracts/server-push.contract.d.ts +44 -0
- package/dist/contracts/server-push.contract.d.ts.map +1 -0
- package/dist/contracts/server-push.contract.js +273 -0
- package/dist/contracts/server-push.contract.js.map +1 -0
- package/dist/doubles/entity-facet-counter.d.ts +2 -2
- package/dist/doubles/entity-facet-counter.d.ts.map +1 -1
- package/dist/doubles/entity-facet-counter.js.map +1 -1
- package/dist/doubles/entity-repository.js.map +1 -1
- package/dist/doubles/server-push.d.ts +16 -0
- package/dist/doubles/server-push.d.ts.map +1 -0
- package/dist/doubles/server-push.js +38 -0
- package/dist/doubles/server-push.js.map +1 -0
- package/dist/doubles/transaction-ports.d.ts +2 -2
- package/dist/doubles/transaction-ports.d.ts.map +1 -1
- package/dist/doubles/transaction-ports.js.map +1 -1
- package/dist/drivers/fake-mongo.d.ts +1 -1
- package/dist/drivers/fake-mongo.js.map +1 -1
- package/dist/drivers/fake-sql.d.ts +1 -1
- package/dist/drivers/fake-sql.js.map +1 -1
- package/dist/effect/run.d.ts +1 -1
- package/dist/effect/run.js +1 -1
- package/dist/effect/run.js.map +1 -1
- package/dist/http/entity-handlers.d.ts +1 -1
- package/dist/http/entity-handlers.js +1 -1
- package/dist/http/entity-handlers.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/effect/run.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const runUC: <TValue, TError, TContext>(effect: Effect.Effect<TVa
|
|
|
12
12
|
*
|
|
13
13
|
* Asserting on the error value beats asserting that a promise rejected: it is
|
|
14
14
|
* the difference between "something went wrong" and "it failed with the
|
|
15
|
-
* `
|
|
15
|
+
* `Contention` the shell turns into a 409".
|
|
16
16
|
*/
|
|
17
17
|
export declare const expectFailure: <TValue, TError, TContext>(effect: Effect.Effect<TValue, TError, TContext>, layer: Layer.Layer<TContext>) => Promise<TError>;
|
|
18
18
|
/**
|
package/dist/effect/run.js
CHANGED
|
@@ -11,7 +11,7 @@ import { Cause, Effect, Exit, Option } from 'effect';
|
|
|
11
11
|
*
|
|
12
12
|
* Asserting on the error value beats asserting that a promise rejected: it is
|
|
13
13
|
* the difference between "something went wrong" and "it failed with the
|
|
14
|
-
* `
|
|
14
|
+
* `Contention` the shell turns into a 409".
|
|
15
15
|
*/ export const expectFailure = async (effect, layer)=>{
|
|
16
16
|
const exit = await Effect.runPromiseExit(Effect.provide(effect, layer));
|
|
17
17
|
if (Exit.isSuccess(exit)) {
|
package/dist/effect/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/effect/run.ts"],"sourcesContent":["import { Cause, Effect, Exit, type Layer, Option } from 'effect';\n\n/**\n * Runs an Effect that still requires `TContext`, providing it from `layer`.\n *\n * Use-cases are `Effect.gen` blocks yielding Context tags; every spec would\n * otherwise repeat the same `Effect.runPromise(uc.pipe(Effect.provide(…)))`\n * incantation.\n */\nexport const runUC = <TValue, TError, TContext>(\n effect: Effect.Effect<TValue, TError, TContext>,\n layer: Layer.Layer<TContext>,\n): Promise<TValue> => Effect.runPromise(Effect.provide(effect, layer));\n\n/**\n * Runs an Effect expected to fail and returns its typed error.\n *\n * Asserting on the error value beats asserting that a promise rejected: it is\n * the difference between \"something went wrong\" and \"it failed with the\n * `
|
|
1
|
+
{"version":3,"sources":["../../src/effect/run.ts"],"sourcesContent":["import { Cause, Effect, Exit, type Layer, Option } from 'effect';\n\n/**\n * Runs an Effect that still requires `TContext`, providing it from `layer`.\n *\n * Use-cases are `Effect.gen` blocks yielding Context tags; every spec would\n * otherwise repeat the same `Effect.runPromise(uc.pipe(Effect.provide(…)))`\n * incantation.\n */\nexport const runUC = <TValue, TError, TContext>(\n effect: Effect.Effect<TValue, TError, TContext>,\n layer: Layer.Layer<TContext>,\n): Promise<TValue> => Effect.runPromise(Effect.provide(effect, layer));\n\n/**\n * Runs an Effect expected to fail and returns its typed error.\n *\n * Asserting on the error value beats asserting that a promise rejected: it is\n * the difference between \"something went wrong\" and \"it failed with the\n * `Contention` the shell turns into a 409\".\n */\nexport const expectFailure = async <TValue, TError, TContext>(\n effect: Effect.Effect<TValue, TError, TContext>,\n layer: Layer.Layer<TContext>,\n): Promise<TError> => {\n const exit = await Effect.runPromiseExit(Effect.provide(effect, layer));\n\n if (Exit.isSuccess(exit)) {\n throw new Error(\n `Expected the effect to fail, but it succeeded with: ${JSON.stringify(\n exit.value,\n )}`,\n );\n }\n\n const failure = Cause.findErrorOption(exit.cause);\n if (Option.isSome(failure)) {\n return failure.value;\n }\n throw new Error(\n `Expected a typed failure, but the effect died with: ${String(exit.cause)}`,\n );\n};\n\n/**\n * Runs an Effect that requires nothing, returning its value.\n *\n * Every repository method is one of these: an adapter binds what it needs when\n * it is built, so a spec runs a repository call with no layer at all.\n */\nexport const run = <TValue, TError>(\n effect: Effect.Effect<TValue, TError>,\n): Promise<TValue> => Effect.runPromise(effect);\n\n/** {@link run}, keeping the exit so a spec can assert on a failure. */\nexport const runExit = <TValue, TError>(\n effect: Effect.Effect<TValue, TError>,\n): Promise<Exit.Exit<TValue, TError>> => Effect.runPromiseExit(effect);\n\n/** Runs an Effect that requires nothing and returns its typed error. */\nexport const runFailure = async <TValue, TError>(\n effect: Effect.Effect<TValue, TError>,\n): Promise<TError> => {\n const exit = await Effect.runPromiseExit(effect);\n\n if (Exit.isSuccess(exit)) {\n throw new Error(\n `Expected the effect to fail, but it succeeded with: ${JSON.stringify(\n exit.value,\n )}`,\n );\n }\n const failure = Cause.findErrorOption(exit.cause);\n if (Option.isSome(failure)) {\n return failure.value;\n }\n throw new Error(\n `Expected a typed failure, but the effect died with: ${String(exit.cause)}`,\n );\n};\n"],"names":["Cause","Effect","Exit","Option","runUC","effect","layer","runPromise","provide","expectFailure","exit","runPromiseExit","isSuccess","Error","JSON","stringify","value","failure","findErrorOption","cause","isSome","String","run","runExit","runFailure"],"mappings":"AAAA,SAASA,KAAK,EAAEC,MAAM,EAAEC,IAAI,EAAcC,MAAM,QAAQ,SAAS;AAEjE;;;;;;CAMC,GACD,OAAO,MAAMC,QAAQ,CACnBC,QACAC,QACoBL,OAAOM,UAAU,CAACN,OAAOO,OAAO,CAACH,QAAQC,QAAQ;AAEvE;;;;;;CAMC,GACD,OAAO,MAAMG,gBAAgB,OAC3BJ,QACAC;IAEA,MAAMI,OAAO,MAAMT,OAAOU,cAAc,CAACV,OAAOO,OAAO,CAACH,QAAQC;IAEhE,IAAIJ,KAAKU,SAAS,CAACF,OAAO;QACxB,MAAM,IAAIG,MACR,CAAC,oDAAoD,EAAEC,KAAKC,SAAS,CACnEL,KAAKM,KAAK,GACT;IAEP;IAEA,MAAMC,UAAUjB,MAAMkB,eAAe,CAACR,KAAKS,KAAK;IAChD,IAAIhB,OAAOiB,MAAM,CAACH,UAAU;QAC1B,OAAOA,QAAQD,KAAK;IACtB;IACA,MAAM,IAAIH,MACR,CAAC,oDAAoD,EAAEQ,OAAOX,KAAKS,KAAK,GAAG;AAE/E,EAAE;AAEF;;;;;CAKC,GACD,OAAO,MAAMG,MAAM,CACjBjB,SACoBJ,OAAOM,UAAU,CAACF,QAAQ;AAEhD,qEAAqE,GACrE,OAAO,MAAMkB,UAAU,CACrBlB,SACuCJ,OAAOU,cAAc,CAACN,QAAQ;AAEvE,sEAAsE,GACtE,OAAO,MAAMmB,aAAa,OACxBnB;IAEA,MAAMK,OAAO,MAAMT,OAAOU,cAAc,CAACN;IAEzC,IAAIH,KAAKU,SAAS,CAACF,OAAO;QACxB,MAAM,IAAIG,MACR,CAAC,oDAAoD,EAAEC,KAAKC,SAAS,CACnEL,KAAKM,KAAK,GACT;IAEP;IACA,MAAMC,UAAUjB,MAAMkB,eAAe,CAACR,KAAKS,KAAK;IAChD,IAAIhB,OAAOiB,MAAM,CAACH,UAAU;QAC1B,OAAOA,QAAQD,KAAK;IACtB;IACA,MAAM,IAAIH,MACR,CAAC,oDAAoD,EAAEQ,OAAOX,KAAKS,KAAK,GAAG;AAE/E,EAAE"}
|
|
@@ -27,7 +27,7 @@ export declare const problem: (failure: EntifixFailure) => HttpResponse<import("
|
|
|
27
27
|
export declare const respondWithProblem: (url: string, failure: EntifixFailure, method?: "get" | "post" | "put" | "delete") => RequestHandler;
|
|
28
28
|
/**
|
|
29
29
|
* The failure handlers. Adapters map transport and shape failures onto
|
|
30
|
-
*
|
|
30
|
+
* typed failures, and those branches are only reachable from here.
|
|
31
31
|
*/
|
|
32
32
|
export declare const respondWith500: (url: string, method?: "get" | "post" | "put" | "delete") => RequestHandler;
|
|
33
33
|
export declare const respondWith404: (url: string, method?: "get" | "post" | "put" | "delete") => RequestHandler;
|
|
@@ -96,7 +96,7 @@ import { http, HttpResponse } from 'msw';
|
|
|
96
96
|
/** Answers every call to `url` with `failure`'s problem body. */ export const respondWithProblem = (url, failure, method = 'get')=>http[method](url, ()=>problem(failure));
|
|
97
97
|
/**
|
|
98
98
|
* The failure handlers. Adapters map transport and shape failures onto
|
|
99
|
-
*
|
|
99
|
+
* typed failures, and those branches are only reachable from here.
|
|
100
100
|
*/ export const respondWith500 = (url, method = 'get')=>http[method](url, ()=>new HttpResponse(null, {
|
|
101
101
|
status: 500
|
|
102
102
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/http/entity-handlers.ts"],"sourcesContent":["import {\n countFacets,\n type EntifixFailure,\n type Entity,\n type EntityConstructor,\n type EntityId,\n InvalidQuery,\n makeEntityEnvelope,\n makeEntityFacetsEnvelope,\n makeEntityPageEnvelope,\n NotFound,\n parseFacetQueryParams,\n PROBLEM_CONTENT_TYPE,\n problemOf,\n} from '@entifix/core';\nimport { http, HttpResponse, type RequestHandler } from 'msw';\n\nexport interface EntityRestHandlerOptions<TEntity extends Entity> {\n /** The collection endpoint, e.g. `http://service/api/product`. */\n baseUrl: string;\n /** The rows the fake service serves. Mutated in place by writes. */\n data?: TEntity[];\n}\n\n/**\n * MSW handlers for the five REST operations the entity adapters issue, and the\n * `$facets` count beside them, speaking the real entifix envelope.\n *\n * Responses are built with `makeEntityEnvelope`/`makeEntityPageEnvelope` — the\n * production serializer — so a fixture cannot drift from the wire format the\n * adapters parse. Hand-written JSON literals in specs are exactly how that\n * drift starts.\n */\nexport const entityRestHandlers = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n { baseUrl, data = [] }: EntityRestHandlerOptions<TEntity>,\n): RequestHandler[] => {\n const rows = data;\n\n const findById = (id: string): TEntity | undefined =>\n rows.find(row => String(row.id) === id);\n\n return [\n http.get(baseUrl, ({ request }) => {\n const url = new URL(request.url);\n const page = Number(url.searchParams.get('page') ?? '1');\n const pageSize = Number(url.searchParams.get('pageSize') ?? '10');\n const start = (page - 1) * pageSize;\n\n return HttpResponse.json(\n makeEntityPageEnvelope(entityConstructor, {\n items: rows.slice(start, start + pageSize),\n total: rows.length,\n request: { page, pageSize },\n }),\n );\n }),\n\n // Registered before `/:id`, which would otherwise take `$facets` for an id.\n // The query goes through the real protocol parser and the in-memory\n // counter, so a refused member is a `400` here as it is at the service.\n http.get(`${baseUrl}/$facets`, ({ request }) => {\n try {\n const queries = parseFacetQueryParams(\n entityConstructor,\n new URL(request.url).searchParams,\n );\n return HttpResponse.json(\n makeEntityFacetsEnvelope(\n entityConstructor,\n countFacets(rows, queries),\n ),\n );\n } catch (error) {\n return problem(new InvalidQuery({ reason: (error as Error).message }));\n }\n }),\n\n http.get(`${baseUrl}/:id`, ({ params }) => {\n const found = findById(String(params['id']));\n return found === undefined\n ? problem(new NotFound())\n : HttpResponse.json(makeEntityEnvelope(entityConstructor, found));\n }),\n\n http.post(baseUrl, async ({ request }) => {\n const body = (await request.json()) as { data: Record<string, unknown> };\n // The service is what mints an id on create; echoing the request back\n // unchanged would hide that the adapter must read the response.\n const created = Object.assign(new entityConstructor(), body.data, {\n id: body.data['id'] ?? `generated-${rows.length + 1}`,\n }) as TEntity;\n rows.push(created);\n return HttpResponse.json(makeEntityEnvelope(entityConstructor, created), {\n status: 201,\n });\n }),\n\n http.put(`${baseUrl}/:id`, async ({ params, request }) => {\n const body = (await request.json()) as { data: Record<string, unknown> };\n const id = String(params['id']);\n const index = rows.findIndex(row => String(row.id) === id);\n const updated = Object.assign(\n new entityConstructor(),\n body.data,\n ) as TEntity;\n if (index === -1) {\n rows.push(updated);\n } else {\n rows[index] = updated;\n }\n return HttpResponse.json(makeEntityEnvelope(entityConstructor, updated));\n }),\n\n // A delete answers with the removed entity's envelope rather than a bare\n // `204`: the shared fetch client always parses the response as JSON, so an\n // empty body would fail that parse — which is what the services do too.\n http.delete(`${baseUrl}/:id`, ({ params }) => {\n const id = String(params['id']);\n const index = rows.findIndex(row => String(row.id) === id);\n const [removed] = index === -1 ? [] : rows.splice(index, 1);\n return HttpResponse.json(\n makeEntityEnvelope(\n entityConstructor,\n removed ?? (new entityConstructor() as TEntity),\n ),\n );\n }),\n ];\n};\n\n/** A single entity response, for specs that need one endpoint only. */\nexport const respondWithEntity = <TEntity extends Entity>(\n url: string,\n entityConstructor: EntityConstructor<TEntity>,\n instance: TEntity,\n): RequestHandler =>\n http.get(url, () =>\n HttpResponse.json(makeEntityEnvelope(entityConstructor, instance)),\n );\n\n/**\n * A failure as a service answers it: its problem body, its category's status\n * and the problem content type.\n */\nexport const problem = (failure: EntifixFailure) => {\n const body = problemOf(failure);\n return HttpResponse.json(body, {\n status: body.status,\n headers: { 'content-type': PROBLEM_CONTENT_TYPE },\n });\n};\n\n/** Answers every call to `url` with `failure`'s problem body. */\nexport const respondWithProblem = (\n url: string,\n failure: EntifixFailure,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler => http[method](url, () => problem(failure));\n\n/**\n * The failure handlers. Adapters map transport and shape failures onto\n * `EntifixError`s, and those branches are only reachable from here.\n */\nexport const respondWith500 = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler =>\n http[method](url, () => new HttpResponse(null, { status: 500 }));\n\nexport const respondWith404 = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler =>\n http[method](url, () => new HttpResponse(null, { status: 404 }));\n\n/** Answers 200 with a body that is not an envelope at all. */\nexport const respondWithMalformedEnvelope = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n body: Record<string, unknown> = { id: 'raw', name: 'not an envelope' },\n): RequestHandler => http[method](url, () => HttpResponse.json(body));\n\n/** Answers 200 with a body that is not JSON. */\nexport const respondWithNonJson = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler =>\n http[method](\n url,\n () => new HttpResponse('<html>nope</html>', { status: 200 }),\n );\n\n/** Fails the request at the transport level, as a dropped connection would. */\nexport const respondWithNetworkError = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler => http[method](url, () => HttpResponse.error());\n\nexport type { RequestHandler } from 'msw';\nexport { http, HttpResponse } from 'msw';\n\n/** Re-exported so `EntityId` stays available to handler authors. */\nexport type { EntityId };\n"],"names":["countFacets","InvalidQuery","makeEntityEnvelope","makeEntityFacetsEnvelope","makeEntityPageEnvelope","NotFound","parseFacetQueryParams","PROBLEM_CONTENT_TYPE","problemOf","http","HttpResponse","entityRestHandlers","entityConstructor","baseUrl","data","rows","findById","id","find","row","String","get","request","url","URL","page","Number","searchParams","pageSize","start","json","items","slice","total","length","queries","error","problem","reason","message","params","found","undefined","post","body","created","Object","assign","push","status","put","index","findIndex","updated","delete","removed","splice","respondWithEntity","instance","failure","headers","respondWithProblem","method","respondWith500","respondWith404","respondWithMalformedEnvelope","name","respondWithNonJson","respondWithNetworkError"],"mappings":"AAAA,SACEA,WAAW,EAKXC,YAAY,EACZC,kBAAkB,EAClBC,wBAAwB,EACxBC,sBAAsB,EACtBC,QAAQ,EACRC,qBAAqB,EACrBC,oBAAoB,EACpBC,SAAS,QACJ,gBAAgB;AACvB,SAASC,IAAI,EAAEC,YAAY,QAA6B,MAAM;AAS9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,mBACA,EAAEC,OAAO,EAAEC,OAAO,EAAE,EAAqC;IAEzD,MAAMC,OAAOD;IAEb,MAAME,WAAW,CAACC,KAChBF,KAAKG,IAAI,CAACC,CAAAA,MAAOC,OAAOD,IAAIF,EAAE,MAAMA;IAEtC,OAAO;QACLR,KAAKY,GAAG,CAACR,SAAS,CAAC,EAAES,OAAO,EAAE;gBAERC,uBACIA;YAFxB,MAAMA,MAAM,IAAIC,IAAIF,QAAQC,GAAG;YAC/B,MAAME,OAAOC,QAAOH,wBAAAA,IAAII,YAAY,CAACN,GAAG,CAAC,mBAArBE,wBAAgC;YACpD,MAAMK,WAAWF,QAAOH,yBAAAA,IAAII,YAAY,CAACN,GAAG,CAAC,uBAArBE,yBAAoC;YAC5D,MAAMM,QAAQ,AAACJ,CAAAA,OAAO,CAAA,IAAKG;YAE3B,OAAOlB,aAAaoB,IAAI,CACtB1B,uBAAuBQ,mBAAmB;gBACxCmB,OAAOhB,KAAKiB,KAAK,CAACH,OAAOA,QAAQD;gBACjCK,OAAOlB,KAAKmB,MAAM;gBAClBZ,SAAS;oBAAEG;oBAAMG;gBAAS;YAC5B;QAEJ;QAEA,4EAA4E;QAC5E,oEAAoE;QACpE,wEAAwE;QACxEnB,KAAKY,GAAG,CAAC,GAAGR,QAAQ,QAAQ,CAAC,EAAE,CAAC,EAAES,OAAO,EAAE;YACzC,IAAI;gBACF,MAAMa,UAAU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AAO,MAAMI,iBAAiB,CAC5BxC,KACAuC,SAA4C,KAAK,GAEjDrD,IAAI,CAACqD,OAAO,CAACvC,KAAK,IAAM,IAAIb,aAAa,MAAM;YAAEuC,QAAQ;QAAI,IAAI;AAEnE,OAAO,MAAMe,iBAAiB,CAC5BzC,KACAuC,SAA4C,KAAK,GAEjDrD,IAAI,CAACqD,OAAO,CAACvC,KAAK,IAAM,IAAIb,aAAa,MAAM;YAAEuC,QAAQ;QAAI,IAAI;AAEnE,4DAA4D,GAC5D,OAAO,MAAMgB,+BAA+B,CAC1C1C,KACAuC,SAA4C,KAAK,EACjDlB,OAAgC;IAAE3B,IAAI;IAAOiD,MAAM;AAAkB,CAAC,GACnDzD,IAAI,CAACqD,OAAO,CAACvC,KAAK,IAAMb,aAAaoB,IAAI,CAACc,OAAO;AAEtE,8CAA8C,GAC9C,OAAO,MAAMuB,qBAAqB,CAChC5C,KACAuC,SAA4C,KAAK,GAEjDrD,IAAI,CAACqD,OAAO,CACVvC,KACA,IAAM,IAAIb,aAAa,qBAAqB;YAAEuC,QAAQ;QAAI,IAC1D;AAEJ,6EAA6E,GAC7E,OAAO,MAAMmB,0BAA0B,CACrC7C,KACAuC,SAA4C,KAAK,GAC9BrD,IAAI,CAACqD,OAAO,CAACvC,KAAK,IAAMb,aAAa0B,KAAK,IAAI;AAGnE,SAAS3B,IAAI,EAAEC,YAAY,QAAQ,MAAM"}
|
|
1
|
+
{"version":3,"sources":["../../src/http/entity-handlers.ts"],"sourcesContent":["import {\n countFacets,\n type EntifixFailure,\n type Entity,\n type EntityConstructor,\n type EntityId,\n InvalidQuery,\n makeEntityEnvelope,\n makeEntityFacetsEnvelope,\n makeEntityPageEnvelope,\n NotFound,\n parseFacetQueryParams,\n PROBLEM_CONTENT_TYPE,\n problemOf,\n} from '@entifix/core';\nimport { http, HttpResponse, type RequestHandler } from 'msw';\n\nexport interface EntityRestHandlerOptions<TEntity extends Entity> {\n /** The collection endpoint, e.g. `http://service/api/product`. */\n baseUrl: string;\n /** The rows the fake service serves. Mutated in place by writes. */\n data?: TEntity[];\n}\n\n/**\n * MSW handlers for the five REST operations the entity adapters issue, and the\n * `$facets` count beside them, speaking the real entifix envelope.\n *\n * Responses are built with `makeEntityEnvelope`/`makeEntityPageEnvelope` — the\n * production serializer — so a fixture cannot drift from the wire format the\n * adapters parse. Hand-written JSON literals in specs are exactly how that\n * drift starts.\n */\nexport const entityRestHandlers = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n { baseUrl, data = [] }: EntityRestHandlerOptions<TEntity>,\n): RequestHandler[] => {\n const rows = data;\n\n const findById = (id: string): TEntity | undefined =>\n rows.find(row => String(row.id) === id);\n\n return [\n http.get(baseUrl, ({ request }) => {\n const url = new URL(request.url);\n const page = Number(url.searchParams.get('page') ?? '1');\n const pageSize = Number(url.searchParams.get('pageSize') ?? '10');\n const start = (page - 1) * pageSize;\n\n return HttpResponse.json(\n makeEntityPageEnvelope(entityConstructor, {\n items: rows.slice(start, start + pageSize),\n total: rows.length,\n request: { page, pageSize },\n }),\n );\n }),\n\n // Registered before `/:id`, which would otherwise take `$facets` for an id.\n // The query goes through the real protocol parser and the in-memory\n // counter, so a refused member is a `400` here as it is at the service.\n http.get(`${baseUrl}/$facets`, ({ request }) => {\n try {\n const queries = parseFacetQueryParams(\n entityConstructor,\n new URL(request.url).searchParams,\n );\n return HttpResponse.json(\n makeEntityFacetsEnvelope(\n entityConstructor,\n countFacets(rows, queries),\n ),\n );\n } catch (error) {\n return problem(new InvalidQuery({ reason: (error as Error).message }));\n }\n }),\n\n http.get(`${baseUrl}/:id`, ({ params }) => {\n const found = findById(String(params['id']));\n return found === undefined\n ? problem(new NotFound())\n : HttpResponse.json(makeEntityEnvelope(entityConstructor, found));\n }),\n\n http.post(baseUrl, async ({ request }) => {\n const body = (await request.json()) as { data: Record<string, unknown> };\n // The service is what mints an id on create; echoing the request back\n // unchanged would hide that the adapter must read the response.\n const created = Object.assign(new entityConstructor(), body.data, {\n id: body.data['id'] ?? `generated-${rows.length + 1}`,\n }) as TEntity;\n rows.push(created);\n return HttpResponse.json(makeEntityEnvelope(entityConstructor, created), {\n status: 201,\n });\n }),\n\n http.put(`${baseUrl}/:id`, async ({ params, request }) => {\n const body = (await request.json()) as { data: Record<string, unknown> };\n const id = String(params['id']);\n const index = rows.findIndex(row => String(row.id) === id);\n const updated = Object.assign(\n new entityConstructor(),\n body.data,\n ) as TEntity;\n if (index === -1) {\n rows.push(updated);\n } else {\n rows[index] = updated;\n }\n return HttpResponse.json(makeEntityEnvelope(entityConstructor, updated));\n }),\n\n // A delete answers with the removed entity's envelope rather than a bare\n // `204`: the shared fetch client always parses the response as JSON, so an\n // empty body would fail that parse — which is what the services do too.\n http.delete(`${baseUrl}/:id`, ({ params }) => {\n const id = String(params['id']);\n const index = rows.findIndex(row => String(row.id) === id);\n const [removed] = index === -1 ? [] : rows.splice(index, 1);\n return HttpResponse.json(\n makeEntityEnvelope(\n entityConstructor,\n removed ?? (new entityConstructor() as TEntity),\n ),\n );\n }),\n ];\n};\n\n/** A single entity response, for specs that need one endpoint only. */\nexport const respondWithEntity = <TEntity extends Entity>(\n url: string,\n entityConstructor: EntityConstructor<TEntity>,\n instance: TEntity,\n): RequestHandler =>\n http.get(url, () =>\n HttpResponse.json(makeEntityEnvelope(entityConstructor, instance)),\n );\n\n/**\n * A failure as a service answers it: its problem body, its category's status\n * and the problem content type.\n */\nexport const problem = (failure: EntifixFailure) => {\n const body = problemOf(failure);\n return HttpResponse.json(body, {\n status: body.status,\n headers: { 'content-type': PROBLEM_CONTENT_TYPE },\n });\n};\n\n/** Answers every call to `url` with `failure`'s problem body. */\nexport const respondWithProblem = (\n url: string,\n failure: EntifixFailure,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler => http[method](url, () => problem(failure));\n\n/**\n * The failure handlers. Adapters map transport and shape failures onto\n * typed failures, and those branches are only reachable from here.\n */\nexport const respondWith500 = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler =>\n http[method](url, () => new HttpResponse(null, { status: 500 }));\n\nexport const respondWith404 = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler =>\n http[method](url, () => new HttpResponse(null, { status: 404 }));\n\n/** Answers 200 with a body that is not an envelope at all. */\nexport const respondWithMalformedEnvelope = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n body: Record<string, unknown> = { id: 'raw', name: 'not an envelope' },\n): RequestHandler => http[method](url, () => HttpResponse.json(body));\n\n/** Answers 200 with a body that is not JSON. */\nexport const respondWithNonJson = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler =>\n http[method](\n url,\n () => new HttpResponse('<html>nope</html>', { status: 200 }),\n );\n\n/** Fails the request at the transport level, as a dropped connection would. */\nexport const respondWithNetworkError = (\n url: string,\n method: 'get' | 'post' | 'put' | 'delete' = 'get',\n): RequestHandler => http[method](url, () => HttpResponse.error());\n\nexport type { RequestHandler } from 'msw';\nexport { http, HttpResponse } from 'msw';\n\n/** Re-exported so `EntityId` stays available to handler authors. */\nexport type { EntityId };\n"],"names":["countFacets","InvalidQuery","makeEntityEnvelope","makeEntityFacetsEnvelope","makeEntityPageEnvelope","NotFound","parseFacetQueryParams","PROBLEM_CONTENT_TYPE","problemOf","http","HttpResponse","entityRestHandlers","entityConstructor","baseUrl","data","rows","findById","id","find","row","String","get","request","url","URL","page","Number","searchParams","pageSize","start","json","items","slice","total","length","queries","error","problem","reason","message","params","found","undefined","post","body","created","Object","assign","push","status","put","index","findIndex","updated","delete","removed","splice","respondWithEntity","instance","failure","headers","respondWithProblem","method","respondWith500","respondWith404","respondWithMalformedEnvelope","name","respondWithNonJson","respondWithNetworkError"],"mappings":"AAAA,SACEA,WAAW,EAKXC,YAAY,EACZC,kBAAkB,EAClBC,wBAAwB,EACxBC,sBAAsB,EACtBC,QAAQ,EACRC,qBAAqB,EACrBC,oBAAoB,EACpBC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AAK,IAAM,IAAIb,aAAa,MAAM;YAAEuC,QAAQ;QAAI,IAAI;AAEnE,4DAA4D,GAC5D,OAAO,MAAMgB,+BAA+B,CAC1C1C,KACAuC,SAA4C,KAAK,EACjDlB,OAAgC;IAAE3B,IAAI;IAAOiD,MAAM;AAAkB,CAAC,GACnDzD,IAAI,CAACqD,OAAO,CAACvC,KAAK,IAAMb,aAAaoB,IAAI,CAACc,OAAO;AAEtE,8CAA8C,GAC9C,OAAO,MAAMuB,qBAAqB,CAChC5C,KACAuC,SAA4C,KAAK,GAEjDrD,IAAI,CAACqD,OAAO,CACVvC,KACA,IAAM,IAAIb,aAAa,qBAAqB;YAAEuC,QAAQ;QAAI,IAC1D;AAEJ,6EAA6E,GAC7E,OAAO,MAAMmB,0BAA0B,CACrC7C,KACAuC,SAA4C,KAAK,GAC9BrD,IAAI,CAACqD,OAAO,CAACvC,KAAK,IAAMb,aAAa0B,KAAK,IAAI;AAGnE,SAAS3B,IAAI,EAAEC,YAAY,QAAQ,MAAM"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './doubles/flow-engine.js';
|
|
|
6
6
|
export * from './doubles/idempotency-store.js';
|
|
7
7
|
export * from './doubles/link-resolver.js';
|
|
8
8
|
export * from './doubles/outbox.js';
|
|
9
|
+
export * from './doubles/server-push.js';
|
|
9
10
|
export * from './doubles/transaction-ports.js';
|
|
10
11
|
export * from './doubles/unit-of-work.js';
|
|
11
12
|
export * from './effect/run.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from './doubles/flow-engine.js';
|
|
|
6
6
|
export * from './doubles/idempotency-store.js';
|
|
7
7
|
export * from './doubles/link-resolver.js';
|
|
8
8
|
export * from './doubles/outbox.js';
|
|
9
|
+
export * from './doubles/server-push.js';
|
|
9
10
|
export * from './doubles/transaction-ports.js';
|
|
10
11
|
export * from './doubles/unit-of-work.js';
|
|
11
12
|
export * from './effect/run.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './builders/entity-builder.js';\nexport * from './doubles/configuration.js';\nexport * from './doubles/entity-facet-counter.js';\nexport * from './doubles/entity-repository.js';\nexport * from './doubles/flow-engine.js';\nexport * from './doubles/idempotency-store.js';\nexport * from './doubles/link-resolver.js';\nexport * from './doubles/outbox.js';\nexport * from './doubles/transaction-ports.js';\nexport * from './doubles/unit-of-work.js';\nexport * from './effect/run.js';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,6BAA6B;AAC3C,cAAc,oCAAoC;AAClD,cAAc,iCAAiC;AAC/C,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,6BAA6B;AAC3C,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,4BAA4B;AAC1C,cAAc,kBAAkB"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './builders/entity-builder.js';\nexport * from './doubles/configuration.js';\nexport * from './doubles/entity-facet-counter.js';\nexport * from './doubles/entity-repository.js';\nexport * from './doubles/flow-engine.js';\nexport * from './doubles/idempotency-store.js';\nexport * from './doubles/link-resolver.js';\nexport * from './doubles/outbox.js';\nexport * from './doubles/server-push.js';\nexport * from './doubles/transaction-ports.js';\nexport * from './doubles/unit-of-work.js';\nexport * from './effect/run.js';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,6BAA6B;AAC3C,cAAc,oCAAoC;AAClD,cAAc,iCAAiC;AAC/C,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,6BAA6B;AAC3C,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,4BAA4B;AAC1C,cAAc,kBAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/testing-unit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Test doubles for entifix: in-memory ports, driver fakes for Mongo, Redis, RabbitMQ and SQL, MSW handlers and port contract suites.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -72,17 +72,17 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@swc/helpers": "0.5.23",
|
|
75
|
-
"@entifix/
|
|
76
|
-
"@entifix/
|
|
77
|
-
"@entifix/transactions": "0.
|
|
75
|
+
"@entifix/core": "0.14.0",
|
|
76
|
+
"@entifix/business": "0.14.0",
|
|
77
|
+
"@entifix/transactions": "0.14.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@testing-library/react": "*",
|
|
81
|
-
"effect": "^4.0.
|
|
81
|
+
"effect": "^4.0.7",
|
|
82
82
|
"msw": ">=3",
|
|
83
83
|
"react": "*",
|
|
84
84
|
"vitest": "*",
|
|
85
|
-
"@entifix/react-controls": "0.
|
|
85
|
+
"@entifix/react-controls": "0.14.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependenciesMeta": {
|
|
88
88
|
"@entifix/react-controls": {
|
|
@@ -105,6 +105,6 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"effect": "4.0.
|
|
108
|
+
"effect": "4.0.7"
|
|
109
109
|
}
|
|
110
110
|
}
|