@equisoft/react-test-utils 0.0.1-snapshot.20230613025427

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/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @equisoft/react-test-utils
2
+
3
+ This library regroup utils to help test React components with Jest and Typescript.
4
+
5
+ ## How to install
6
+
7
+ ```
8
+ yarn add -DE @equisoft/react-test-utils
9
+ ```
@@ -0,0 +1,5 @@
1
+ import { Mocked } from 'jest-mock';
2
+ import { ComponentProps, FunctionComponent, JSXElementConstructor } from 'react';
3
+ type MockedComponent<T> = keyof JSX.IntrinsicElements | JSXElementConstructor<T>;
4
+ export declare function mockedClassComponent<T extends MockedComponent<ComponentProps<T>>>(component: T): Mocked<FunctionComponent<ComponentProps<T>>>;
5
+ export {};
package/dist/mocks.js ADDED
@@ -0,0 +1,4 @@
1
+ import { mocked } from 'jest-mock';
2
+ export function mockedClassComponent(component) {
3
+ return mocked(component);
4
+ }
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@equisoft/react-test-utils",
3
+ "version": "0.0.1-snapshot.20230613025427",
4
+ "files": [
5
+ "dist"
6
+ ],
7
+ "devDependencies": {
8
+ "@equisoft/eslint-config-typescript": "3.0.3",
9
+ "@equisoft/jest-utils": "0.0.0",
10
+ "@equisoft/typescript-config": "2.0.0",
11
+ "@jest/types": "29.5.0",
12
+ "@microsoft/eslint-formatter-sarif": "3.0.0",
13
+ "@types/jest": "29.5.2",
14
+ "@types/react": "18.2.12",
15
+ "@types/react-dom": "18.2.5",
16
+ "@types/react-test-renderer": "18.0.0",
17
+ "@typescript-eslint/eslint-plugin": "5.59.11",
18
+ "@typescript-eslint/parser": "5.59.11",
19
+ "eslint": "8.42.0",
20
+ "eslint-import-resolver-node": "0.3.7",
21
+ "eslint-import-resolver-typescript": "3.5.5",
22
+ "eslint-plugin-import": "2.27.5",
23
+ "jest": "29.5.0",
24
+ "jest-environment-jsdom": "29.5.0",
25
+ "jest-junit": "16.0.0",
26
+ "jest-mock": "29.5.0",
27
+ "react": "18.2.0",
28
+ "react-dom": "18.2.0",
29
+ "react-test-renderer": "18.2.0",
30
+ "ts-jest": "29.1.0",
31
+ "typescript": "5.0.4",
32
+ "yargs": "17.7.2"
33
+ },
34
+ "exports": {
35
+ "./mocks": "./dist/mocks.js",
36
+ "./dist/mocks": "./dist/mocks.js"
37
+ },
38
+ "peerDependencies": {
39
+ "jest-mock": ">=29",
40
+ "react": "*"
41
+ },
42
+ "scripts": {
43
+ "build": "tsc",
44
+ "eslint": "eslint src test",
45
+ "eslint:ci": "yarn eslint",
46
+ "test": "jest --config ./test/jest.config.js",
47
+ "test:ci": "yarn test"
48
+ }
49
+ }