joist-test-utils 1.37.9 → 1.38.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/build/context.d.ts +1 -1
- package/build/run.d.ts +2 -2
- package/build/toMatchEntity.d.ts +1 -1
- package/package.json +2 -2
package/build/context.d.ts
CHANGED
package/build/run.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "./context";
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
3
|
+
export type ContextFn<C> = (ctx: C) => MaybePromise<C>;
|
|
4
4
|
/** Runs the `fn` in a dedicated / non-test Unit of Work . */
|
|
5
5
|
export declare function run<C extends Context, T>(ctx: C, fn: (ctx: C) => MaybePromise<T>, contextFn?: ContextFn<C>): Promise<T>;
|
|
6
6
|
/** Creates a `run` with a custom `newContext` method. */
|
package/build/toMatchEntity.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function toMatchEntity<T>(actual: Entity, expected: MatchedEntity
|
|
|
11
11
|
* We allow `| null` so that `toMatchEntity` can work against optional fields
|
|
12
12
|
* that are returned from GraphQL object resolvers.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type MatchedEntity<T> = {
|
|
15
15
|
[K in keyof T]?: T[K] extends Reference<any, infer U, any> ? MatchedEntity<U> | U : T[K] extends Collection<any, infer U> ? Array<MatchedEntity<U> | U> : T[K] extends AsyncProperty<any, infer V> ? V : T[K] extends Entity | null | undefined ? MatchedEntity<T[K]> | T[K] | null | undefined : T[K] extends ReadonlyArray<infer U | undefined> ? readonly (MatchedEntity<U> | U | undefined)[] : T[K] extends ReadonlyArray<infer U> | null ? readonly (MatchedEntity<U> | U | null)[] : // We recurse similar to a DeepPartial
|
|
16
16
|
MatchedEntity<T[K]> | null;
|
|
17
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joist-test-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"prettier-plugin-organize-imports": "^3.1.1",
|
|
23
23
|
"ts-node-dev": "^2.0.0",
|
|
24
24
|
"tsconfig-paths": "^4.0.0",
|
|
25
|
-
"typescript": "^4.
|
|
25
|
+
"typescript": "^4.9.3"
|
|
26
26
|
}
|
|
27
27
|
}
|