Skip to content

Commit 130a362

Browse files
finished conversion to jest
1 parent b69e967 commit 130a362

6 files changed

Lines changed: 1927 additions & 398 deletions

File tree

babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// eslint-disable-next-line no-undef
2+
module.exports = {
3+
presets: ["module:@react-native/babel-preset"],
4+
}

jest.config.js

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,21 @@
11
module.exports = {
2-
testEnvironment: "node",
3-
injectGlobals: true,
42
globals: {
53
__SDK_VERSION__: "test-version",
64
},
7-
setupFiles: [
8-
"./test/mocks/react_native.ts",
9-
"./test/setup.ts",
10-
"./test/mocks/react_native_webview.ts",
11-
],
12-
setupFilesAfterEnv: [
13-
"./test/mocks/setup.ts",
5+
preset: "react-native",
6+
collectCoverageFrom: ["src/**/**"],
7+
setupFiles: ["./test/setup.ts"],
8+
setupFilesAfterEnv: ["./test/mocks/setup.ts", "./test/mocks/react_native_webview.ts"],
9+
testRegex: ["_test\\.[jt]sx?$"],
10+
testPathIgnorePatterns: [
11+
"<rootDir>/node_modules",
12+
"<rootDir>/dist",
13+
"<rootDir>/build",
14+
"<rootDir>/example",
1415
],
15-
collectCoverageFrom: ["src/**/*"],
16-
coverageReporters: ["text", "json", "html", "lcov"],
17-
testMatch: ["**/*_test.{ts,tsx}"],
18-
testPathIgnorePatterns: ["/node_modules/", "/dist/", "/build/", "/example/"],
19-
transform: {
20-
"^.+\\.(ts|tsx)$": [
21-
"ts-jest",
22-
{
23-
tsconfig: {
24-
jsx: "react",
25-
esModuleInterop: true,
26-
},
27-
},
28-
],
29-
"^.+\\.m?js$": [
30-
"ts-jest",
31-
{
32-
tsconfig: {
33-
allowJs: true,
34-
esModuleInterop: true,
35-
},
36-
},
37-
],
16+
transformIgnorePatterns: ["node_modules/(?!@ngrx|(?!deck.gl)|ng-dynamic)"],
17+
testEnvironment: "node",
18+
moduleNameMapper: {
19+
"^msw/node$": "<rootDir>/node_modules/msw/lib/node/index.js",
3820
},
39-
transformIgnorePatterns: [
40-
"node_modules/(?!(react-native|@react-native|react-native-webview|react-native-base64|msw|@mswjs|until-async|@mxenabled)/)",
41-
],
42-
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
43-
};
21+
}

0 commit comments

Comments
 (0)