xenopomp-essentials 0.4.1 → 0.5.0-canary.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/package.json +6 -4
- package/vitest/index.d.mts +26 -0
- package/vitest/index.d.ts +26 -0
- package/vitest/index.mjs +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xenopomp-essentials",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-canary.0",
|
|
4
4
|
"author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"main": "./index.mjs",
|
|
25
25
|
"types": "./index.d.ts",
|
|
26
26
|
"peerDependencies": {
|
|
27
|
+
"@testing-library/react": "^16",
|
|
27
28
|
"@types/node": ">=22",
|
|
28
29
|
"@types/react": ">=19",
|
|
29
30
|
"@types/react-dom": ">=19",
|
|
@@ -35,11 +36,13 @@
|
|
|
35
36
|
"react-dom": ">=19",
|
|
36
37
|
"type-fest": ">=4",
|
|
37
38
|
"typescript": ">=5.4",
|
|
39
|
+
"vitest": "^4",
|
|
38
40
|
"zod": "*"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"@antfu/eslint-config": "^4.10.1",
|
|
42
44
|
"@next/eslint-plugin-next": "^15.2.3",
|
|
45
|
+
"@testing-library/react": "^16.3.0",
|
|
43
46
|
"@types/react": "^19.2.0",
|
|
44
47
|
"deepmerge-ts": "^7.1.5",
|
|
45
48
|
"eslint": "^9.22.0",
|
|
@@ -51,12 +54,12 @@
|
|
|
51
54
|
"transliteration": "^2.3.5",
|
|
52
55
|
"type-fest": "^4.33.0",
|
|
53
56
|
"typescript": "^5.7.3",
|
|
57
|
+
"vitest": "^4.0.14",
|
|
54
58
|
"zod": "^3.24.1"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
61
|
"@eslint-react/eslint-plugin": "^1.36.1",
|
|
58
62
|
"@testing-library/dom": "^10.4.0",
|
|
59
|
-
"@testing-library/react": "^16.2.0",
|
|
60
63
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
|
61
64
|
"@vitejs/plugin-react": "^4.3.4",
|
|
62
65
|
"@vitest/coverage-istanbul": "^3.2.4",
|
|
@@ -76,7 +79,6 @@
|
|
|
76
79
|
"tsd": "^0.31.2",
|
|
77
80
|
"unbuild": "^3.3.1",
|
|
78
81
|
"vite": "7.1.5",
|
|
79
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
80
|
-
"vitest": "^3.2.4"
|
|
82
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
81
83
|
}
|
|
82
84
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { renderHook, render } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
/** Executes function and expects that it won't throw. */
|
|
4
|
+
declare const assertNotThrowing: (callable: () => void) => void;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Deeply checks if two objects are equal.
|
|
8
|
+
*
|
|
9
|
+
* @param expected
|
|
10
|
+
* @param real
|
|
11
|
+
*/
|
|
12
|
+
declare const expectToDeepEqual: <Type>(expected: Type, real: NoInfer<Type>) => void;
|
|
13
|
+
|
|
14
|
+
type RenderArguments = Parameters<typeof render>;
|
|
15
|
+
type RenderHookArguments = Parameters<typeof renderHook>;
|
|
16
|
+
type RenderFunc<Args extends unknown[] = RenderArguments> = (...args: Args) => void;
|
|
17
|
+
/** Renders component and expects that it won't throw error. */
|
|
18
|
+
declare const expectToRender: RenderFunc;
|
|
19
|
+
/**
|
|
20
|
+
* Renders hook within test React component without having to create that component yourself.
|
|
21
|
+
* Expects that it won't throw error.
|
|
22
|
+
* @param props
|
|
23
|
+
*/
|
|
24
|
+
declare const expectHookToRender: RenderFunc<RenderHookArguments>;
|
|
25
|
+
|
|
26
|
+
export { assertNotThrowing, expectHookToRender, expectToDeepEqual, expectToRender };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { renderHook, render } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
/** Executes function and expects that it won't throw. */
|
|
4
|
+
declare const assertNotThrowing: (callable: () => void) => void;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Deeply checks if two objects are equal.
|
|
8
|
+
*
|
|
9
|
+
* @param expected
|
|
10
|
+
* @param real
|
|
11
|
+
*/
|
|
12
|
+
declare const expectToDeepEqual: <Type>(expected: Type, real: NoInfer<Type>) => void;
|
|
13
|
+
|
|
14
|
+
type RenderArguments = Parameters<typeof render>;
|
|
15
|
+
type RenderHookArguments = Parameters<typeof renderHook>;
|
|
16
|
+
type RenderFunc<Args extends unknown[] = RenderArguments> = (...args: Args) => void;
|
|
17
|
+
/** Renders component and expects that it won't throw error. */
|
|
18
|
+
declare const expectToRender: RenderFunc;
|
|
19
|
+
/**
|
|
20
|
+
* Renders hook within test React component without having to create that component yourself.
|
|
21
|
+
* Expects that it won't throw error.
|
|
22
|
+
* @param props
|
|
23
|
+
*/
|
|
24
|
+
declare const expectHookToRender: RenderFunc<RenderHookArguments>;
|
|
25
|
+
|
|
26
|
+
export { assertNotThrowing, expectHookToRender, expectToDeepEqual, expectToRender };
|
package/vitest/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{expect as t}from"vitest";import{render as n,renderHook as p}from"@testing-library/react";const o=e=>{t(()=>e()).not.toThrow()},c=(e,r)=>{t(e).to.deep.equal(r)},d=(...e)=>{o(()=>n(...e))},s=(...e)=>{o(()=>p(...e))};export{o as assertNotThrowing,s as expectHookToRender,c as expectToDeepEqual,d as expectToRender};
|