joist-test-utils 2.4.0-next.31 → 2.4.0-next.33

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["BaseEntity"],"sources":["../src/index.ts"],"sourcesContent":["import { BaseEntity } from \"joist-core\";\n\nimport { type MatchedEntity } from \"./toMatchEntity.ts\";\nexport type { Context } from \"./context.ts\";\nexport { type ContextFn, makeRun, makeRunEach, newContext, run, runEach } from \"./run.ts\";\nexport { RunPlugin } from \"./RunPlugin.ts\";\nexport { seed, type SeedConfig } from \"./seed.ts\";\nexport { toMatchEntity } from \"./toMatchEntity.ts\";\n\nexport interface CustomMatcherResult {\n pass: boolean;\n message: () => string;\n}\n\ndeclare global {\n namespace jest {\n interface Matchers<R extends void | Promise<void>, T = {}> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n }\n}\n// @ts-ignore\ndeclare module \"expect\" {\n interface Matchers<R extends void | Promise<void>, T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"bun:test\" {\n interface Matchers<T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"vitest\" {\n interface Assertion<T = any> {\n toMatchEntity(expected: MatchedEntity<T>): void;\n }\n interface AsymmetricMatchersContaining {\n toMatchEntity(expected: MatchedEntity<any>): void;\n }\n}\n\n/**\n * A custom equality tester for Jest, i.e. install it like:\n *\n * ```\n * import { expect } from \"@jest/globals\";\n * expect.addEqualityTesters([areEntitiesEqual]);\n * ```\n *\n * This is necessary because Jest's `expect` uses deep equality for instances\n * of classes, but the `__data` key marked as non-enumerable, and all properties\n * made lazy and defined as getters on the prototype, there are no keys on the\n * individual objects left for Jest to see & realize \"these are different\".\n */\nexport function areEntitiesEqual(a: unknown, b: unknown) {\n if (a instanceof BaseEntity && b instanceof BaseEntity) {\n return a === b || (a.em !== b.em && !a.isNewEntity && !b.isNewEntity && a.id === b.id);\n } else if (typeof a === \"string\" && b instanceof BaseEntity) {\n return a === b.id;\n } else if (typeof b === \"string\" && a instanceof BaseEntity) {\n return b === a.id;\n } else {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0DA,SAAgB,iBAAiB,GAAY,GAAY;CACvD,IAAI,aAAaA,WAAAA,cAAc,aAAaA,WAAAA,YAC1C,OAAO,MAAM,KAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE;MAC9E,IAAI,OAAO,MAAM,YAAY,aAAaA,WAAAA,YAC/C,OAAO,MAAM,EAAE;MACV,IAAI,OAAO,MAAM,YAAY,aAAaA,WAAAA,YAC/C,OAAO,MAAM,EAAE;MAEf;AAEJ"}
1
+ {"version":3,"file":"index.cjs","names":["BaseEntity"],"sources":["../src/index.ts"],"sourcesContent":["import { BaseEntity } from \"joist-core\";\n\nimport { type MatchedEntity } from \"./toMatchEntity.ts\";\nexport type { Context } from \"./context.ts\";\nexport { type ContextFn, makeRun, makeRunEach, newContext, run, runEach } from \"./run.ts\";\nexport { RunPlugin } from \"./RunPlugin.ts\";\nexport { seed, type SeedConfig } from \"./seed.ts\";\nexport { toMatchEntity } from \"./toMatchEntity.ts\";\n\nexport interface CustomMatcherResult {\n pass: boolean;\n message: () => string;\n}\n\ndeclare global {\n namespace jest {\n interface Matchers<R extends void | Promise<void>, T = {}> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n }\n}\n// @ts-ignore\ndeclare module \"expect\" {\n interface Matchers<R extends void | Promise<void>, T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"bun:test\" {\n interface Matchers<T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"vitest\" {\n interface Matchers<R, T = {}> {\n toMatchEntity(expected: MatchedEntity<T>): R;\n }\n interface AsymmetricMatchersContaining {\n toMatchEntity(expected: MatchedEntity<any>): void;\n }\n}\n\n/**\n * A custom equality tester for Jest, i.e. install it like:\n *\n * ```\n * import { expect } from \"@jest/globals\";\n * expect.addEqualityTesters([areEntitiesEqual]);\n * ```\n *\n * This is necessary because Jest's `expect` uses deep equality for instances\n * of classes, but the `__data` key marked as non-enumerable, and all properties\n * made lazy and defined as getters on the prototype, there are no keys on the\n * individual objects left for Jest to see & realize \"these are different\".\n */\nexport function areEntitiesEqual(a: unknown, b: unknown) {\n if (a instanceof BaseEntity && b instanceof BaseEntity) {\n return a === b || (a.em !== b.em && !a.isNewEntity && !b.isNewEntity && a.id === b.id);\n } else if (typeof a === \"string\" && b instanceof BaseEntity) {\n return a === b.id;\n } else if (typeof b === \"string\" && a instanceof BaseEntity) {\n return b === a.id;\n } else {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0DA,SAAgB,iBAAiB,GAAY,GAAY;CACvD,IAAI,aAAaA,WAAAA,cAAc,aAAaA,WAAAA,YAC1C,OAAO,MAAM,KAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE;MAC9E,IAAI,OAAO,MAAM,YAAY,aAAaA,WAAAA,YAC/C,OAAO,MAAM,EAAE;MACV,IAAI,OAAO,MAAM,YAAY,aAAaA,WAAAA,YAC/C,OAAO,MAAM,EAAE;MAEf;AAEJ"}
package/build/index.d.cts CHANGED
@@ -26,8 +26,8 @@ declare module "bun:test" {
26
26
  }
27
27
  }
28
28
  declare module "vitest" {
29
- interface Assertion<T = any> {
30
- toMatchEntity(expected: MatchedEntity<T>): void;
29
+ interface Matchers<R, T = {}> {
30
+ toMatchEntity(expected: MatchedEntity<T>): R;
31
31
  }
32
32
  interface AsymmetricMatchersContaining {
33
33
  toMatchEntity(expected: MatchedEntity<any>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;UASiB;EACf;EACA;;QAGM;YACI;cACE,SAAS,iBAAiB,eAAe;MACjD,cAAc,UAAU,cAAc,KAAK;;;;;YAMrC,SAAS,iBAAiB,eAAe;IACjD,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,SAAS;IACjB,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,UAAU;IAClB,cAAc,UAAU,cAAc;;YAE9B;IACR,cAAc,UAAU;;;;;;;;;;;;;;;;iBAiBZ,iBAAiB,YAAY"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;UASiB;EACf;EACA;;QAGM;YACI;cACE,SAAS,iBAAiB,eAAe;MACjD,cAAc,UAAU,cAAc,KAAK;;;;;YAMrC,SAAS,iBAAiB,eAAe;IACjD,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,SAAS;IACjB,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,SAAS,GAAG;IACpB,cAAc,UAAU,cAAc,KAAK;;YAEnC;IACR,cAAc,UAAU;;;;;;;;;;;;;;;;iBAiBZ,iBAAiB,YAAY"}
package/build/index.d.mts CHANGED
@@ -26,8 +26,8 @@ declare module "bun:test" {
26
26
  }
27
27
  }
28
28
  declare module "vitest" {
29
- interface Assertion<T = any> {
30
- toMatchEntity(expected: MatchedEntity<T>): void;
29
+ interface Matchers<R, T = {}> {
30
+ toMatchEntity(expected: MatchedEntity<T>): R;
31
31
  }
32
32
  interface AsymmetricMatchersContaining {
33
33
  toMatchEntity(expected: MatchedEntity<any>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;UASiB;EACf;EACA;;QAGM;YACI;cACE,SAAS,iBAAiB,eAAe;MACjD,cAAc,UAAU,cAAc,KAAK;;;;;YAMrC,SAAS,iBAAiB,eAAe;IACjD,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,SAAS;IACjB,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,UAAU;IAClB,cAAc,UAAU,cAAc;;YAE9B;IACR,cAAc,UAAU;;;;;;;;;;;;;;;;iBAiBZ,iBAAiB,YAAY"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;UASiB;EACf;EACA;;QAGM;YACI;cACE,SAAS,iBAAiB,eAAe;MACjD,cAAc,UAAU,cAAc,KAAK;;;;;YAMrC,SAAS,iBAAiB,eAAe;IACjD,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,SAAS;IACjB,cAAc,UAAU,cAAc,KAAK;;;;YAMnC,SAAS,GAAG;IACpB,cAAc,UAAU,cAAc,KAAK;;YAEnC;IACR,cAAc,UAAU;;;;;;;;;;;;;;;;iBAiBZ,iBAAiB,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { BaseEntity } from \"joist-core\";\n\nimport { type MatchedEntity } from \"./toMatchEntity.ts\";\nexport type { Context } from \"./context.ts\";\nexport { type ContextFn, makeRun, makeRunEach, newContext, run, runEach } from \"./run.ts\";\nexport { RunPlugin } from \"./RunPlugin.ts\";\nexport { seed, type SeedConfig } from \"./seed.ts\";\nexport { toMatchEntity } from \"./toMatchEntity.ts\";\n\nexport interface CustomMatcherResult {\n pass: boolean;\n message: () => string;\n}\n\ndeclare global {\n namespace jest {\n interface Matchers<R extends void | Promise<void>, T = {}> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n }\n}\n// @ts-ignore\ndeclare module \"expect\" {\n interface Matchers<R extends void | Promise<void>, T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"bun:test\" {\n interface Matchers<T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"vitest\" {\n interface Assertion<T = any> {\n toMatchEntity(expected: MatchedEntity<T>): void;\n }\n interface AsymmetricMatchersContaining {\n toMatchEntity(expected: MatchedEntity<any>): void;\n }\n}\n\n/**\n * A custom equality tester for Jest, i.e. install it like:\n *\n * ```\n * import { expect } from \"@jest/globals\";\n * expect.addEqualityTesters([areEntitiesEqual]);\n * ```\n *\n * This is necessary because Jest's `expect` uses deep equality for instances\n * of classes, but the `__data` key marked as non-enumerable, and all properties\n * made lazy and defined as getters on the prototype, there are no keys on the\n * individual objects left for Jest to see & realize \"these are different\".\n */\nexport function areEntitiesEqual(a: unknown, b: unknown) {\n if (a instanceof BaseEntity && b instanceof BaseEntity) {\n return a === b || (a.em !== b.em && !a.isNewEntity && !b.isNewEntity && a.id === b.id);\n } else if (typeof a === \"string\" && b instanceof BaseEntity) {\n return a === b.id;\n } else if (typeof b === \"string\" && a instanceof BaseEntity) {\n return b === a.id;\n } else {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0DA,SAAgB,iBAAiB,GAAY,GAAY;CACvD,IAAI,aAAa,cAAc,aAAa,YAC1C,OAAO,MAAM,KAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE;MAC9E,IAAI,OAAO,MAAM,YAAY,aAAa,YAC/C,OAAO,MAAM,EAAE;MACV,IAAI,OAAO,MAAM,YAAY,aAAa,YAC/C,OAAO,MAAM,EAAE;MAEf;AAEJ"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { BaseEntity } from \"joist-core\";\n\nimport { type MatchedEntity } from \"./toMatchEntity.ts\";\nexport type { Context } from \"./context.ts\";\nexport { type ContextFn, makeRun, makeRunEach, newContext, run, runEach } from \"./run.ts\";\nexport { RunPlugin } from \"./RunPlugin.ts\";\nexport { seed, type SeedConfig } from \"./seed.ts\";\nexport { toMatchEntity } from \"./toMatchEntity.ts\";\n\nexport interface CustomMatcherResult {\n pass: boolean;\n message: () => string;\n}\n\ndeclare global {\n namespace jest {\n interface Matchers<R extends void | Promise<void>, T = {}> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n }\n}\n// @ts-ignore\ndeclare module \"expect\" {\n interface Matchers<R extends void | Promise<void>, T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"bun:test\" {\n interface Matchers<T = unknown> {\n toMatchEntity(expected: MatchedEntity<T>): CustomMatcherResult;\n }\n}\n\n// @ts-ignore\ndeclare module \"vitest\" {\n interface Matchers<R, T = {}> {\n toMatchEntity(expected: MatchedEntity<T>): R;\n }\n interface AsymmetricMatchersContaining {\n toMatchEntity(expected: MatchedEntity<any>): void;\n }\n}\n\n/**\n * A custom equality tester for Jest, i.e. install it like:\n *\n * ```\n * import { expect } from \"@jest/globals\";\n * expect.addEqualityTesters([areEntitiesEqual]);\n * ```\n *\n * This is necessary because Jest's `expect` uses deep equality for instances\n * of classes, but the `__data` key marked as non-enumerable, and all properties\n * made lazy and defined as getters on the prototype, there are no keys on the\n * individual objects left for Jest to see & realize \"these are different\".\n */\nexport function areEntitiesEqual(a: unknown, b: unknown) {\n if (a instanceof BaseEntity && b instanceof BaseEntity) {\n return a === b || (a.em !== b.em && !a.isNewEntity && !b.isNewEntity && a.id === b.id);\n } else if (typeof a === \"string\" && b instanceof BaseEntity) {\n return a === b.id;\n } else if (typeof b === \"string\" && a instanceof BaseEntity) {\n return b === a.id;\n } else {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0DA,SAAgB,iBAAiB,GAAY,GAAY;CACvD,IAAI,aAAa,cAAc,aAAa,YAC1C,OAAO,MAAM,KAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE;MAC9E,IAAI,OAAO,MAAM,YAAY,aAAa,YAC/C,OAAO,MAAM,EAAE;MACV,IAAI,OAAO,MAAM,YAAY,aAAa,YAC/C,OAAO,MAAM,EAAE;MAEf;AAEJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joist-test-utils",
3
- "version": "2.4.0-next.31",
3
+ "version": "2.4.0-next.33",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "build/index.cjs",
@@ -34,8 +34,8 @@
34
34
  "dotenv": "^18.0.5"
35
35
  },
36
36
  "peerDependencies": {
37
- "joist-core": "2.4.0-next.31",
38
- "joist-utils": "2.4.0-next.31",
37
+ "joist-core": "2.4.0-next.33",
38
+ "joist-utils": "2.4.0-next.33",
39
39
  "pg": "^8.23.0"
40
40
  },
41
41
  "devDependencies": {