xenopomp-essentials 0.5.0-canary.3 → 0.5.0-canary.5
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/cli-tools/index.mjs +1 -1
- package/index.d.mts +2 -13
- package/index.d.ts +2 -13
- package/package.json +7 -3
- package/shared/xenopomp-essentials.CO5lcTlK.d.mts +14 -0
- package/shared/xenopomp-essentials.CO5lcTlK.d.ts +14 -0
- package/vitest/index.d.mts +85 -2
- package/vitest/index.d.ts +85 -2
- package/vitest/index.mjs +1 -1
- package/shared/xenopomp-essentials.B-Vt61jj.d.mts +0 -3
- package/shared/xenopomp-essentials.B-Vt61jj.d.ts +0 -3
package/cli-tools/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"node:path";import{z as r}from"zod";const
|
|
1
|
+
import s from"node:path";import{z as r}from"zod";import h from"dotenv";const o=r.object({dirname:r.string().optional()}),e=o.parse(import.meta);h.config({quiet:!0});const a=r.object({DISABLE_MINIFY:r.string().optional().transform(i=>i==="true")});a.parse(process.env);class p{paths=[];pushPaths(...t){return this.paths.push(...t),this}cd(...t){return this.pushPaths(...t)}file(t){return this.pushPaths(`./${t}`)}appSource(){return e.dirname?this.pushPaths(s.join(s.dirname(e.dirname),"../")):this.cwd()}cwd(){return this.pushPaths(process.cwd())}clear(){return this.paths=[],this}build(){return s.join(...this.paths)}}export{p as PathBuilder};
|
package/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as PromiseOr } from './shared/xenopomp-essentials.
|
|
1
|
+
export { O as Optional, P as PromiseOr, U as Undefinable } from './shared/xenopomp-essentials.CO5lcTlK.mjs';
|
|
2
2
|
import { ElementType, ComponentProps, FC, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
3
|
import { Jsonifiable } from 'type-fest';
|
|
4
4
|
import * as transliteration from 'transliteration';
|
|
@@ -345,17 +345,6 @@ type ReplaceReturnType<TFn, TR> = TFn extends (...a: infer A) => any ? (...a: A)
|
|
|
345
345
|
*/
|
|
346
346
|
type SelectivePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
347
347
|
|
|
348
|
-
/**
|
|
349
|
-
* Makes type union of type T and undefined
|
|
350
|
-
* @since 0.0.1
|
|
351
|
-
* @deprecated Renamed to {@link Optional}.
|
|
352
|
-
*/
|
|
353
|
-
type Undefinable<T> = T | undefined;
|
|
354
|
-
/**
|
|
355
|
-
* Marks type as optional (undefinable).
|
|
356
|
-
*/
|
|
357
|
-
type Optional<T> = T | undefined;
|
|
358
|
-
|
|
359
348
|
/**
|
|
360
349
|
* The strict version of Omit. Allows to remove only
|
|
361
350
|
* keys that are presented in T type.
|
|
@@ -618,4 +607,4 @@ declare const minmax: (num: number, [min, max]: [min: number | undefined, max: n
|
|
|
618
607
|
declare function jsxDotNotation<Props = EmptyObject, Rest extends Record<string, FC<any>> = EmptyObject>(comp: FC<Props>, rest: Rest): FC<Props> & Rest;
|
|
619
608
|
|
|
620
609
|
export { capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
|
|
621
|
-
export type { AnyFC, AnyObject, ArrayItemType, ArrayType, AsyncFC, AsyncReturnType, AsyncVariableFC, DataAttributes, Defined, EmptyObject, FCProps, FcProps, Fn, FunctionalChildren, InjectDeep, Jsonish, Lenient, LenientAutocomplete, MatchType, MergeTypes, Modify, NextErrorParams, NextParams, NextSearchParams, Nullable, OneOf, OnlyFirst,
|
|
610
|
+
export type { AnyFC, AnyObject, ArrayItemType, ArrayType, AsyncFC, AsyncReturnType, AsyncVariableFC, DataAttributes, Defined, EmptyObject, FCProps, FcProps, Fn, FunctionalChildren, InjectDeep, Jsonish, Lenient, LenientAutocomplete, MatchType, MergeTypes, Modify, NextErrorParams, NextParams, NextSearchParams, Nullable, OneOf, OnlyFirst, Preid, Prettify, PrettifyDeep, RecordKey, RecordValue, ReplaceReturnType, SelectivePartial, SetState, StrictOmit, Synchronous, VariableFC, VariableProps, VersionData, WeakOmit, Writeable, WriteableDeep };
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as PromiseOr } from './shared/xenopomp-essentials.
|
|
1
|
+
export { O as Optional, P as PromiseOr, U as Undefinable } from './shared/xenopomp-essentials.CO5lcTlK.js';
|
|
2
2
|
import { ElementType, ComponentProps, FC, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
3
|
import { Jsonifiable } from 'type-fest';
|
|
4
4
|
import * as transliteration from 'transliteration';
|
|
@@ -345,17 +345,6 @@ type ReplaceReturnType<TFn, TR> = TFn extends (...a: infer A) => any ? (...a: A)
|
|
|
345
345
|
*/
|
|
346
346
|
type SelectivePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
347
347
|
|
|
348
|
-
/**
|
|
349
|
-
* Makes type union of type T and undefined
|
|
350
|
-
* @since 0.0.1
|
|
351
|
-
* @deprecated Renamed to {@link Optional}.
|
|
352
|
-
*/
|
|
353
|
-
type Undefinable<T> = T | undefined;
|
|
354
|
-
/**
|
|
355
|
-
* Marks type as optional (undefinable).
|
|
356
|
-
*/
|
|
357
|
-
type Optional<T> = T | undefined;
|
|
358
|
-
|
|
359
348
|
/**
|
|
360
349
|
* The strict version of Omit. Allows to remove only
|
|
361
350
|
* keys that are presented in T type.
|
|
@@ -618,4 +607,4 @@ declare const minmax: (num: number, [min, max]: [min: number | undefined, max: n
|
|
|
618
607
|
declare function jsxDotNotation<Props = EmptyObject, Rest extends Record<string, FC<any>> = EmptyObject>(comp: FC<Props>, rest: Rest): FC<Props> & Rest;
|
|
619
608
|
|
|
620
609
|
export { capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
|
|
621
|
-
export type { AnyFC, AnyObject, ArrayItemType, ArrayType, AsyncFC, AsyncReturnType, AsyncVariableFC, DataAttributes, Defined, EmptyObject, FCProps, FcProps, Fn, FunctionalChildren, InjectDeep, Jsonish, Lenient, LenientAutocomplete, MatchType, MergeTypes, Modify, NextErrorParams, NextParams, NextSearchParams, Nullable, OneOf, OnlyFirst,
|
|
610
|
+
export type { AnyFC, AnyObject, ArrayItemType, ArrayType, AsyncFC, AsyncReturnType, AsyncVariableFC, DataAttributes, Defined, EmptyObject, FCProps, FcProps, Fn, FunctionalChildren, InjectDeep, Jsonish, Lenient, LenientAutocomplete, MatchType, MergeTypes, Modify, NextErrorParams, NextParams, NextSearchParams, Nullable, OneOf, OnlyFirst, Preid, Prettify, PrettifyDeep, RecordKey, RecordValue, ReplaceReturnType, SelectivePartial, SetState, StrictOmit, Synchronous, VariableFC, VariableProps, VersionData, WeakOmit, Writeable, WriteableDeep };
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xenopomp-essentials",
|
|
3
|
-
"version": "0.5.0-canary.
|
|
3
|
+
"version": "0.5.0-canary.5",
|
|
4
4
|
"author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
6
|
"private": false,
|
|
8
7
|
"repository": {
|
|
9
8
|
"type": "git",
|
|
@@ -19,10 +18,12 @@
|
|
|
19
18
|
"lint": "run-p lint:**",
|
|
20
19
|
"lint:code": "eslint",
|
|
21
20
|
"vitest": "vitest -c ./.config/vitest.config.ts",
|
|
21
|
+
"vitest:intergrity": "vitest -c ./.config/vitest.config.integrity.ts",
|
|
22
22
|
"coverage": "yarn vitest run --coverage",
|
|
23
23
|
"test:unit:watch": "yarn vitest",
|
|
24
24
|
"test:unit:once": "yarn test:unit:watch --run",
|
|
25
|
-
"prepare": "husky"
|
|
25
|
+
"prepare": "husky",
|
|
26
|
+
"test:integrity": "yarn build ; yarn vitest:intergrity run"
|
|
26
27
|
},
|
|
27
28
|
"main": "./index.mjs",
|
|
28
29
|
"types": "./index.d.ts",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"type-fest": ">=4",
|
|
41
42
|
"typescript": ">=5.4",
|
|
42
43
|
"vitest": "^4",
|
|
44
|
+
"vitest-matchmedia-mock": "^2",
|
|
43
45
|
"zod": "*"
|
|
44
46
|
},
|
|
45
47
|
"dependencies": {
|
|
@@ -56,6 +58,7 @@
|
|
|
56
58
|
"@vitest/spy": "^4.0.14",
|
|
57
59
|
"ansi-colors": "^4.1.3",
|
|
58
60
|
"deepmerge-ts": "^7.1.5",
|
|
61
|
+
"dotenv": "^17.2.3",
|
|
59
62
|
"eslint": "^9.22.0",
|
|
60
63
|
"eslint-config-prettier": "^10.1.1",
|
|
61
64
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
@@ -69,6 +72,7 @@
|
|
|
69
72
|
"type-fest": "^4.33.0",
|
|
70
73
|
"typescript": "^5.7.3",
|
|
71
74
|
"vitest": "^4.0.14",
|
|
75
|
+
"vitest-matchmedia-mock": "^2.0.3",
|
|
72
76
|
"zod": "^3.24.1"
|
|
73
77
|
},
|
|
74
78
|
"devDependencies": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type PromiseOr<T> = T | Promise<T>;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Makes type union of type T and undefined
|
|
5
|
+
* @since 0.0.1
|
|
6
|
+
* @deprecated Renamed to {@link Optional}.
|
|
7
|
+
*/
|
|
8
|
+
type Undefinable<T> = T | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Marks type as optional (undefinable).
|
|
11
|
+
*/
|
|
12
|
+
type Optional<T> = T | undefined;
|
|
13
|
+
|
|
14
|
+
export type { Optional as O, PromiseOr as P, Undefinable as U };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type PromiseOr<T> = T | Promise<T>;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Makes type union of type T and undefined
|
|
5
|
+
* @since 0.0.1
|
|
6
|
+
* @deprecated Renamed to {@link Optional}.
|
|
7
|
+
*/
|
|
8
|
+
type Undefinable<T> = T | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Marks type as optional (undefinable).
|
|
11
|
+
*/
|
|
12
|
+
type Optional<T> = T | undefined;
|
|
13
|
+
|
|
14
|
+
export type { Optional as O, PromiseOr as P, Undefinable as U };
|
package/vitest/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { P as PromiseOr } from '../shared/xenopomp-essentials.
|
|
1
|
+
import { P as PromiseOr, O as Optional } from '../shared/xenopomp-essentials.CO5lcTlK.mjs';
|
|
2
2
|
import { render, renderHook } from '@testing-library/react';
|
|
3
3
|
import * as vitest from 'vitest';
|
|
4
|
+
import { beforeAll, afterEach, Mock } from 'vitest';
|
|
4
5
|
import * as _vitest_spy from '@vitest/spy';
|
|
6
|
+
import { PartialDeep } from 'type-fest';
|
|
5
7
|
|
|
6
8
|
/** Executes function and expects that it won't throw. */
|
|
7
9
|
declare const assertNotThrowing: <T = void>(callable: () => PromiseOr<T>) => void;
|
|
@@ -90,4 +92,85 @@ declare function spyFactory(context: string): {
|
|
|
90
92
|
callSpy: Caller;
|
|
91
93
|
};
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Mocks global scope object.
|
|
97
|
+
*
|
|
98
|
+
* @param name
|
|
99
|
+
* @param stub
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* stubGlobal<typeof navigator>('navigator', {
|
|
103
|
+
* clipboard: {
|
|
104
|
+
* writeText: async (text: string) => vi.fn(),
|
|
105
|
+
* },
|
|
106
|
+
* });
|
|
107
|
+
*/
|
|
108
|
+
declare const stubGlobal: <Global extends object>(name: string, stub: PartialDeep<Stub<Global>>) => void;
|
|
109
|
+
|
|
110
|
+
type Fn = () => void;
|
|
111
|
+
type Strategy = keyof typeof strategies;
|
|
112
|
+
type AfterAllCallback = Optional<Fn> | void;
|
|
113
|
+
/**
|
|
114
|
+
* Map of all available strategies for
|
|
115
|
+
* injectMocks function.
|
|
116
|
+
*/
|
|
117
|
+
declare const strategies: {
|
|
118
|
+
beforeAll: typeof beforeAll;
|
|
119
|
+
afterEach: typeof afterEach;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Inserts mocks according to selected strategy
|
|
123
|
+
* (default is `beforeAll`).
|
|
124
|
+
*
|
|
125
|
+
* This function takes approach of useEffect hook
|
|
126
|
+
* from React. You define mocks inside function body,
|
|
127
|
+
* then you return function, that will be called
|
|
128
|
+
* in `afterAll` event.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* injectMocks(() => {
|
|
132
|
+
* mockRouter();
|
|
133
|
+
*
|
|
134
|
+
* return () => {
|
|
135
|
+
* console.log('This is printed from injectMocks func (afterAll event).');
|
|
136
|
+
* };
|
|
137
|
+
* });
|
|
138
|
+
*/
|
|
139
|
+
declare const injectMocks: (func: () => AfterAllCallback, strategy?: Strategy) => void;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Mocks stuff related to window.matchMedia.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* describe('Root layout test', () => {
|
|
146
|
+
* // Use it inside describe suite. Place it to top
|
|
147
|
+
* injectMatchMediaMock();
|
|
148
|
+
*
|
|
149
|
+
* injectMocks(() => {
|
|
150
|
+
* vi.mock('next/font/google', () => ({
|
|
151
|
+
* Inter: FONT_MOCK,
|
|
152
|
+
* }));
|
|
153
|
+
* });
|
|
154
|
+
*
|
|
155
|
+
* testNextPage(<RootLayout children={undefined} />, {
|
|
156
|
+
* generateMetadata,
|
|
157
|
+
* });
|
|
158
|
+
* });
|
|
159
|
+
*/
|
|
160
|
+
declare const injectMatchMediaMock: () => void;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Recursevely changes all keys` types inside T to R.
|
|
164
|
+
*/
|
|
165
|
+
type TypeReplaceDeep<T extends object, R> = {
|
|
166
|
+
[K in keyof T]: T[K] extends object ? TypeReplaceDeep<T[K], R> : R;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
type StubValue = Mock | (() => Mock) | (() => Promise<Mock>);
|
|
170
|
+
/**
|
|
171
|
+
* Represents vi stub object.
|
|
172
|
+
*/
|
|
173
|
+
type Stub<T extends object> = TypeReplaceDeep<T, StubValue>;
|
|
174
|
+
|
|
175
|
+
export { assertHookRendering, assertNotThrowing, assertRendering, clearMocks, injectMatchMediaMock, injectMocks, mockEnv, mockRouter, spyFactory, stubGlobal, twApiMock };
|
|
176
|
+
export type { Stub, TypeReplaceDeep };
|
package/vitest/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { P as PromiseOr } from '../shared/xenopomp-essentials.
|
|
1
|
+
import { P as PromiseOr, O as Optional } from '../shared/xenopomp-essentials.CO5lcTlK.js';
|
|
2
2
|
import { render, renderHook } from '@testing-library/react';
|
|
3
3
|
import * as vitest from 'vitest';
|
|
4
|
+
import { beforeAll, afterEach, Mock } from 'vitest';
|
|
4
5
|
import * as _vitest_spy from '@vitest/spy';
|
|
6
|
+
import { PartialDeep } from 'type-fest';
|
|
5
7
|
|
|
6
8
|
/** Executes function and expects that it won't throw. */
|
|
7
9
|
declare const assertNotThrowing: <T = void>(callable: () => PromiseOr<T>) => void;
|
|
@@ -90,4 +92,85 @@ declare function spyFactory(context: string): {
|
|
|
90
92
|
callSpy: Caller;
|
|
91
93
|
};
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Mocks global scope object.
|
|
97
|
+
*
|
|
98
|
+
* @param name
|
|
99
|
+
* @param stub
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* stubGlobal<typeof navigator>('navigator', {
|
|
103
|
+
* clipboard: {
|
|
104
|
+
* writeText: async (text: string) => vi.fn(),
|
|
105
|
+
* },
|
|
106
|
+
* });
|
|
107
|
+
*/
|
|
108
|
+
declare const stubGlobal: <Global extends object>(name: string, stub: PartialDeep<Stub<Global>>) => void;
|
|
109
|
+
|
|
110
|
+
type Fn = () => void;
|
|
111
|
+
type Strategy = keyof typeof strategies;
|
|
112
|
+
type AfterAllCallback = Optional<Fn> | void;
|
|
113
|
+
/**
|
|
114
|
+
* Map of all available strategies for
|
|
115
|
+
* injectMocks function.
|
|
116
|
+
*/
|
|
117
|
+
declare const strategies: {
|
|
118
|
+
beforeAll: typeof beforeAll;
|
|
119
|
+
afterEach: typeof afterEach;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Inserts mocks according to selected strategy
|
|
123
|
+
* (default is `beforeAll`).
|
|
124
|
+
*
|
|
125
|
+
* This function takes approach of useEffect hook
|
|
126
|
+
* from React. You define mocks inside function body,
|
|
127
|
+
* then you return function, that will be called
|
|
128
|
+
* in `afterAll` event.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* injectMocks(() => {
|
|
132
|
+
* mockRouter();
|
|
133
|
+
*
|
|
134
|
+
* return () => {
|
|
135
|
+
* console.log('This is printed from injectMocks func (afterAll event).');
|
|
136
|
+
* };
|
|
137
|
+
* });
|
|
138
|
+
*/
|
|
139
|
+
declare const injectMocks: (func: () => AfterAllCallback, strategy?: Strategy) => void;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Mocks stuff related to window.matchMedia.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* describe('Root layout test', () => {
|
|
146
|
+
* // Use it inside describe suite. Place it to top
|
|
147
|
+
* injectMatchMediaMock();
|
|
148
|
+
*
|
|
149
|
+
* injectMocks(() => {
|
|
150
|
+
* vi.mock('next/font/google', () => ({
|
|
151
|
+
* Inter: FONT_MOCK,
|
|
152
|
+
* }));
|
|
153
|
+
* });
|
|
154
|
+
*
|
|
155
|
+
* testNextPage(<RootLayout children={undefined} />, {
|
|
156
|
+
* generateMetadata,
|
|
157
|
+
* });
|
|
158
|
+
* });
|
|
159
|
+
*/
|
|
160
|
+
declare const injectMatchMediaMock: () => void;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Recursevely changes all keys` types inside T to R.
|
|
164
|
+
*/
|
|
165
|
+
type TypeReplaceDeep<T extends object, R> = {
|
|
166
|
+
[K in keyof T]: T[K] extends object ? TypeReplaceDeep<T[K], R> : R;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
type StubValue = Mock | (() => Mock) | (() => Promise<Mock>);
|
|
170
|
+
/**
|
|
171
|
+
* Represents vi stub object.
|
|
172
|
+
*/
|
|
173
|
+
type Stub<T extends object> = TypeReplaceDeep<T, StubValue>;
|
|
174
|
+
|
|
175
|
+
export { assertHookRendering, assertNotThrowing, assertRendering, clearMocks, injectMatchMediaMock, injectMocks, mockEnv, mockRouter, spyFactory, stubGlobal, twApiMock };
|
|
176
|
+
export type { Stub, TypeReplaceDeep };
|
package/vitest/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expect as c,vi as t}from"vitest";import{render as
|
|
1
|
+
import{expect as c,vi as t,afterEach as f,beforeAll as u,afterAll as h}from"vitest";import{render as d,renderHook as m}from"@testing-library/react";import l from"ansi-colors";import p from"vitest-matchmedia-mock";const a=e=>{c(()=>e()).not.toThrow()},b=(...e)=>{a(()=>d(...e))},C=(...e)=>{a(()=>m(...e))},k=e=>{t.stubEnv("CANONICAL_URL","http://localhost:4242"),t.stubEnv("IS_PRODUCTION","false"),e&&Object.entries(e).forEach(([o,n])=>t.stubEnv(o,n))},r=()=>{t.clearAllMocks(),t.resetAllMocks(),t.unstubAllEnvs(),t.unstubAllGlobals()},x=()=>{t.mock("next/navigation",()=>({useRouter:()=>({push(){}}),usePathname:()=>"/"}))},A={addBase:t.fn(),addComponents:t.fn(),addUtilities:t.fn(),addVariant:t.fn(),config:t.fn(),corePlugins:t.fn(),e:t.fn(),matchComponents:t.fn(),matchUtilities:t.fn(),matchVariant:t.fn(),theme:t.fn()};class g{_executionContext;constructor(o){this._executionContext=o}call(...o){console.debug(`${l.blue(`[${this._executionContext}]`)} ${l.green(`Custom spy is called with these args: ${l.blueBright(o.map(n=>`${n}`).join(", "))}`)}`)}}function v(e){const o=new g(e),n=t.spyOn(o,"call");return{expectToBeCalled:(...s)=>c(n).toHaveBeenCalledWith(s),expectToBeNotCalled:(...s)=>c(n).not.toHaveBeenCalledWith(s),spy:n,callSpy:(...s)=>o.call(s)}}const E=(e,o)=>{t.stubGlobal(e,o)},M={beforeAll:u,afterEach:f},i=(e,o="beforeAll")=>{let n;M[o](()=>n=e()),h(()=>{r(),n?.()})},y=()=>{const e=new p;i(()=>(e.clear(),()=>e.destroy()),"afterEach")};export{C as assertHookRendering,a as assertNotThrowing,b as assertRendering,r as clearMocks,y as injectMatchMediaMock,i as injectMocks,k as mockEnv,x as mockRouter,v as spyFactory,E as stubGlobal,A as twApiMock};
|