@quilted/quilt 0.6.0 → 0.6.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.
- package/CHANGELOG.md +14 -0
- package/build/esm/graphql/testing/matchers/operations.mjs +2 -2
- package/build/esm/graphql/testing/matchers/utilities.mjs +1 -1
- package/build/esm/react/testing.mjs +1 -1
- package/build/esnext/graphql/testing/matchers/operations.esnext +4 -6
- package/build/esnext/graphql/testing/matchers/utilities.esnext +1 -1
- package/build/esnext/react/testing.esnext +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/assets/files.d.ts +97 -0
- package/build/typescript/assets/files.d.ts.map +1 -0
- package/build/typescript/assets/styles.d.ts +11 -0
- package/build/typescript/assets/styles.d.ts.map +1 -0
- package/build/typescript/assets.d.ts +2 -0
- package/build/typescript/assets.d.ts.map +1 -1
- package/build/typescript/globals.d.ts +2 -0
- package/build/typescript/globals.d.ts.map +1 -1
- package/build/typescript/graphql/testing/matchers/operations.d.ts +2 -2
- package/build/typescript/graphql/testing/matchers/operations.d.ts.map +1 -1
- package/build/typescript/graphql/testing/matchers/utilities.d.ts +1 -0
- package/build/typescript/graphql/testing/matchers/utilities.d.ts.map +1 -1
- package/build/typescript/react/testing.d.ts +3 -3
- package/build/typescript/react/testing.d.ts.map +1 -1
- package/package.json +1 -1
- package/source/assets/files.ts +129 -0
- package/source/assets/styles.ts +9 -0
- package/source/assets.ts +3 -0
- package/source/globals.ts +2 -0
- package/source/graphql/testing/matchers/operations.ts +10 -8
- package/source/graphql/testing/matchers/utilities.ts +1 -1
- package/source/react/testing.ts +3 -7
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
declare module '*.jpg' {
|
|
2
|
+
const source: string;
|
|
3
|
+
export default source;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.jpeg' {
|
|
6
|
+
const source: string;
|
|
7
|
+
export default source;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.png' {
|
|
10
|
+
const source: string;
|
|
11
|
+
export default source;
|
|
12
|
+
}
|
|
13
|
+
declare module '*.gif' {
|
|
14
|
+
const source: string;
|
|
15
|
+
export default source;
|
|
16
|
+
}
|
|
17
|
+
declare module '*.svg' {
|
|
18
|
+
const source: string;
|
|
19
|
+
export default source;
|
|
20
|
+
}
|
|
21
|
+
declare module '*.ico' {
|
|
22
|
+
const source: string;
|
|
23
|
+
export default source;
|
|
24
|
+
}
|
|
25
|
+
declare module '*.webp' {
|
|
26
|
+
const source: string;
|
|
27
|
+
export default source;
|
|
28
|
+
}
|
|
29
|
+
declare module '*.avif' {
|
|
30
|
+
const source: string;
|
|
31
|
+
export default source;
|
|
32
|
+
}
|
|
33
|
+
declare module '*.mp4' {
|
|
34
|
+
const source: string;
|
|
35
|
+
export default source;
|
|
36
|
+
}
|
|
37
|
+
declare module '*.webm' {
|
|
38
|
+
const source: string;
|
|
39
|
+
export default source;
|
|
40
|
+
}
|
|
41
|
+
declare module '*.ogg' {
|
|
42
|
+
const source: string;
|
|
43
|
+
export default source;
|
|
44
|
+
}
|
|
45
|
+
declare module '*.mp3' {
|
|
46
|
+
const source: string;
|
|
47
|
+
export default source;
|
|
48
|
+
}
|
|
49
|
+
declare module '*.wav' {
|
|
50
|
+
const source: string;
|
|
51
|
+
export default source;
|
|
52
|
+
}
|
|
53
|
+
declare module '*.flac' {
|
|
54
|
+
const source: string;
|
|
55
|
+
export default source;
|
|
56
|
+
}
|
|
57
|
+
declare module '*.aac' {
|
|
58
|
+
const source: string;
|
|
59
|
+
export default source;
|
|
60
|
+
}
|
|
61
|
+
declare module '*.woff' {
|
|
62
|
+
const source: string;
|
|
63
|
+
export default source;
|
|
64
|
+
}
|
|
65
|
+
declare module '*.woff2' {
|
|
66
|
+
const source: string;
|
|
67
|
+
export default source;
|
|
68
|
+
}
|
|
69
|
+
declare module '*.eot' {
|
|
70
|
+
const source: string;
|
|
71
|
+
export default source;
|
|
72
|
+
}
|
|
73
|
+
declare module '*.ttf' {
|
|
74
|
+
const source: string;
|
|
75
|
+
export default source;
|
|
76
|
+
}
|
|
77
|
+
declare module '*.otf' {
|
|
78
|
+
const source: string;
|
|
79
|
+
export default source;
|
|
80
|
+
}
|
|
81
|
+
declare module '*.webmanifest' {
|
|
82
|
+
const source: string;
|
|
83
|
+
export default source;
|
|
84
|
+
}
|
|
85
|
+
declare module '*.pdf' {
|
|
86
|
+
const source: string;
|
|
87
|
+
export default source;
|
|
88
|
+
}
|
|
89
|
+
declare module '*.txt' {
|
|
90
|
+
const source: string;
|
|
91
|
+
export default source;
|
|
92
|
+
}
|
|
93
|
+
declare module '*?raw' {
|
|
94
|
+
const source: string;
|
|
95
|
+
export default source;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../source/assets/files.ts"],"names":[],"mappings":"AAMA,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,QAAQ,CAAC;IACtB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,QAAQ,CAAC;IACtB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,QAAQ,CAAC;IACtB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,QAAQ,CAAC;IACtB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,QAAQ,CAAC;IACtB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAID,OAAO,QAAQ,QAAQ,CAAC;IACtB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,SAAS,CAAC;IACvB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,eAAe,CAAC;IAC7B,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB;AAID,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../source/assets/styles.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,cAAc,CAAC;IAC5B,MAAM,UAAU,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAC;IAC1C,eAAe,UAAU,CAAC;CAC3B;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,MAAM,MAAM,EAAE,MAAM,CAAC;IACrB,eAAe,MAAM,CAAC;CACvB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import './assets/files.ts';
|
|
2
|
+
import './assets/styles.ts';
|
|
1
3
|
export { styleAssetAttributes, styleAssetPreloadAttributes, scriptAssetAttributes, scriptAssetPreloadAttributes, BrowserAssetsFromManifests, createBrowserAssetsEntryFromManifest, } from '@quilted/assets';
|
|
2
4
|
export type { Asset, AssetsCacheKey, BrowserAssets, BrowserAssetsEntry, BrowserAssetSelector, BrowserAssetModuleSelector, AssetsBuildManifest, AssetsBuildManifestEntry, } from '@quilted/assets';
|
|
3
5
|
export { useAssetsCacheKey, useModuleAssets } from '@quilted/react-assets';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../source/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,KAAK,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEzE,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,cAAc;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;CACF"}
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../source/assets.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,KAAK,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEzE,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,cAAc;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../source/globals.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../source/globals.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;CAC3C;AAGD,QAAA,MAAM,KAAK,aAAuD,CAAC;AAanE,eAAe,KAAK,CAAC;AACrB,OAAO,EAAC,KAAK,EAAE,KAAK,IAAI,MAAM,EAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { MatcherState } from 'expect';
|
|
1
|
+
import type { MatcherState, MatcherUtils } from 'expect';
|
|
2
2
|
import type { GraphQLAnyOperation, GraphQLController } from '@quilted/graphql/testing';
|
|
3
|
-
export declare function toHavePerformedGraphQLOperation<Variables>(this: MatcherState, graphql: GraphQLController, operation: GraphQLAnyOperation<any, Variables>, variables?: Variables): {
|
|
3
|
+
export declare function toHavePerformedGraphQLOperation<Variables>(this: MatcherState & MatcherUtils, graphql: GraphQLController, operation: GraphQLAnyOperation<any, Variables>, variables?: Variables): {
|
|
4
4
|
pass: boolean;
|
|
5
5
|
message: () => string;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../source/graphql/testing/matchers/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../source/graphql/testing/matchers/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,QAAQ,CAAC;AAOvD,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,0BAA0B,CAAC;AASlC,wBAAgB,+BAA+B,CAAC,SAAS,EACvD,IAAI,EAAE,YAAY,GAAG,YAAY,EACjC,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,mBAAmB,CAAC,GAAG,EAAE,SAAS,CAAC,EAC9C,SAAS,CAAC,EAAE,SAAS;;;EA8DtB"}
|
|
@@ -5,4 +5,5 @@ export declare function assertIsGraphQLController(graphql: unknown, { expectatio
|
|
|
5
5
|
export declare function diffVariables(actual: Record<string, any>, expected: Record<string, any>, { expand }: {
|
|
6
6
|
expand?: boolean | undefined;
|
|
7
7
|
}): string | null;
|
|
8
|
+
export declare function getObjectSubset(object: any, subset: any): any;
|
|
8
9
|
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../../../source/graphql/testing/matchers/utilities.ts"],"names":[],"mappings":"AAWA,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,EAAC,WAAW,EAAE,KAAa,EAAC,EAAE;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAC,QAarE;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,EAAC,MAAc,EAAC;;CAAA,iBAKjB"}
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../../../source/graphql/testing/matchers/utilities.ts"],"names":[],"mappings":"AAWA,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,EAAC,WAAW,EAAE,KAAa,EAAC,EAAE;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAC,QAarE;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,EAAC,MAAc,EAAC;;CAAA,iBAKjB;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CA4B7D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CustomMatchers } from '@quilted/react-testing/matchers';
|
|
2
|
-
export { render, createRender, rendered, destroyAll, } from '@quilted/react-testing';
|
|
3
|
-
export type { CustomRender, CustomRenderResult, CustomRenderOptions, CustomRenderExtendOptions, HookRunner, Environment, EnvironmentOptions, ContextOption, RenderOption, ActionsOption, Node, NodeApi, Root, RootApi,
|
|
1
|
+
import { type CustomMatchers } from '@quilted/react-testing/matchers';
|
|
2
|
+
export { render, createRender, rendered, destroyAll, } from '@quilted/react-testing/preact';
|
|
3
|
+
export type { CustomRender, CustomRenderResult, CustomRenderOptions, CustomRenderExtendOptions, HookRunner, Environment, EnvironmentOptions, ContextOption, RenderOption, ActionsOption, Node, NodeApi, Root, RootApi, } from '@quilted/react-testing/preact';
|
|
4
4
|
declare module 'vitest' {
|
|
5
5
|
interface Assertion<T = any> extends CustomMatchers<T> {
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../source/react/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,cAAc,EAAC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../source/react/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAE9E,OAAO,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,UAAU,GACX,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,GACR,MAAM,+BAA+B,CAAC;AAEvC,OAAO,QAAQ,QAAQ,CAAC;IACtB,UAAU,SAAS,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;KAAG;IACzD,UAAU,4BAA6B,SAAQ,cAAc;KAAG;CACjE"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Declare modules for file types that are transformed into
|
|
2
|
+
// URL references.
|
|
3
|
+
|
|
4
|
+
// @see https://github.com/lemonmade/quilt/blob/main/packages/rollup/source/features/assets.ts
|
|
5
|
+
// @see https://github.com/vitejs/vite/blob/76fdc27437d37534cf157bf869a648e0d176b267/packages/vite/src/node/constants.ts#L63-L95
|
|
6
|
+
|
|
7
|
+
declare module '*.jpg' {
|
|
8
|
+
const source: string;
|
|
9
|
+
export default source;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module '*.jpeg' {
|
|
13
|
+
const source: string;
|
|
14
|
+
export default source;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module '*.png' {
|
|
18
|
+
const source: string;
|
|
19
|
+
export default source;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const source: string;
|
|
24
|
+
export default source;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare module '*.svg' {
|
|
28
|
+
const source: string;
|
|
29
|
+
export default source;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare module '*.ico' {
|
|
33
|
+
const source: string;
|
|
34
|
+
export default source;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare module '*.webp' {
|
|
38
|
+
const source: string;
|
|
39
|
+
export default source;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module '*.avif' {
|
|
43
|
+
const source: string;
|
|
44
|
+
export default source;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare module '*.mp4' {
|
|
48
|
+
const source: string;
|
|
49
|
+
export default source;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare module '*.webm' {
|
|
53
|
+
const source: string;
|
|
54
|
+
export default source;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare module '*.ogg' {
|
|
58
|
+
const source: string;
|
|
59
|
+
export default source;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare module '*.mp3' {
|
|
63
|
+
const source: string;
|
|
64
|
+
export default source;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare module '*.wav' {
|
|
68
|
+
const source: string;
|
|
69
|
+
export default source;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare module '*.flac' {
|
|
73
|
+
const source: string;
|
|
74
|
+
export default source;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare module '*.aac' {
|
|
78
|
+
const source: string;
|
|
79
|
+
export default source;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// fonts
|
|
83
|
+
|
|
84
|
+
declare module '*.woff' {
|
|
85
|
+
const source: string;
|
|
86
|
+
export default source;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare module '*.woff2' {
|
|
90
|
+
const source: string;
|
|
91
|
+
export default source;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare module '*.eot' {
|
|
95
|
+
const source: string;
|
|
96
|
+
export default source;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare module '*.ttf' {
|
|
100
|
+
const source: string;
|
|
101
|
+
export default source;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare module '*.otf' {
|
|
105
|
+
const source: string;
|
|
106
|
+
export default source;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare module '*.webmanifest' {
|
|
110
|
+
const source: string;
|
|
111
|
+
export default source;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare module '*.pdf' {
|
|
115
|
+
const source: string;
|
|
116
|
+
export default source;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare module '*.txt' {
|
|
120
|
+
const source: string;
|
|
121
|
+
export default source;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Special query params
|
|
125
|
+
|
|
126
|
+
declare module '*?raw' {
|
|
127
|
+
const source: string;
|
|
128
|
+
export default source;
|
|
129
|
+
}
|
package/source/assets.ts
CHANGED
package/source/globals.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {MatcherState} from 'expect';
|
|
1
|
+
import type {MatcherState, MatcherUtils} from 'expect';
|
|
2
2
|
import {
|
|
3
3
|
matcherHint,
|
|
4
4
|
printExpected,
|
|
@@ -12,10 +12,14 @@ import type {
|
|
|
12
12
|
} from '@quilted/graphql/testing';
|
|
13
13
|
import {normalizeOperation} from '@quilted/graphql/ast';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
assertIsGraphQLController,
|
|
17
|
+
diffVariables,
|
|
18
|
+
getObjectSubset,
|
|
19
|
+
} from './utilities.ts';
|
|
16
20
|
|
|
17
21
|
export function toHavePerformedGraphQLOperation<Variables>(
|
|
18
|
-
this: MatcherState,
|
|
22
|
+
this: MatcherState & MatcherUtils,
|
|
19
23
|
graphql: GraphQLController,
|
|
20
24
|
operation: GraphQLAnyOperation<any, Variables>,
|
|
21
25
|
variables?: Variables,
|
|
@@ -33,11 +37,9 @@ export function toHavePerformedGraphQLOperation<Variables>(
|
|
|
33
37
|
variables == null
|
|
34
38
|
? foundByOperation
|
|
35
39
|
: foundByOperation.filter((operation) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
(operation.variables ?? ({} as any))[key],
|
|
40
|
-
),
|
|
40
|
+
this.equals(
|
|
41
|
+
variables,
|
|
42
|
+
getObjectSubset(operation.variables, variables),
|
|
41
43
|
),
|
|
42
44
|
);
|
|
43
45
|
|
|
@@ -37,7 +37,7 @@ export function diffVariables(
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// Original from https://github.com/facebook/jest/blob/master/packages/expect/source/utils.ts#L107
|
|
40
|
-
function getObjectSubset(object: any, subset: any): any {
|
|
40
|
+
export function getObjectSubset(object: any, subset: any): any {
|
|
41
41
|
if (Array.isArray(object)) {
|
|
42
42
|
if (Array.isArray(subset) && subset.length === object.length) {
|
|
43
43
|
return subset.map((sub: any, i: number) =>
|
package/source/react/testing.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {expect} from 'vitest';
|
|
2
|
-
import {matchers, CustomMatchers} from '@quilted/react-testing/matchers';
|
|
2
|
+
import {matchers, type CustomMatchers} from '@quilted/react-testing/matchers';
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
render,
|
|
6
6
|
createRender,
|
|
7
7
|
rendered,
|
|
8
8
|
destroyAll,
|
|
9
|
-
} from '@quilted/react-testing';
|
|
9
|
+
} from '@quilted/react-testing/preact';
|
|
10
10
|
export type {
|
|
11
11
|
CustomRender,
|
|
12
12
|
CustomRenderResult,
|
|
@@ -22,11 +22,7 @@ export type {
|
|
|
22
22
|
NodeApi,
|
|
23
23
|
Root,
|
|
24
24
|
RootApi,
|
|
25
|
-
|
|
26
|
-
EmptyObject,
|
|
27
|
-
PlainObject,
|
|
28
|
-
Predicate,
|
|
29
|
-
} from '@quilted/react-testing';
|
|
25
|
+
} from '@quilted/react-testing/preact';
|
|
30
26
|
|
|
31
27
|
declare module 'vitest' {
|
|
32
28
|
interface Assertion<T = any> extends CustomMatchers<T> {}
|
package/tsconfig.json
CHANGED