Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 35db677

Browse files
committed
🔧 (example) Config test runner in example project
1 parent 4056cc8 commit 35db677

3 files changed

Lines changed: 42 additions & 3347 deletions

File tree

example/jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = {
22
preset: 'react-native',
33
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
4-
moduleDirectories: ['node_modules', '<rootDir>/../node_modules'],
4+
moduleDirectories: ['node_modules', 'example/node_modules'],
5+
rootDir: '..',
6+
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/src/'],
57
};

example/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"scripts": {
66
"start": "node ../node_modules/react-native/local-cli/cli.js start",
77
"test:lint": "cd .. && yarn tslint example/src/**/*.ts{,x} && cd example",
8-
"test:unit": "jest",
9-
"test:unit:ci": "jest --runInBand",
8+
"test:unit": "cd .. && yarn jest --config=example/jest.config.js && cd example",
9+
"test:unit:ci": "cd .. && yarn jest --config=example/jest.config.js --runInBand && cd example",
1010
"test:type": "tsc --noEmit",
1111
"test": "yarn test:lint && yarn test:unit && yarn test:type",
1212
"test:ci": "yarn test:lint && yarn test:unit:ci && yarn test:type"
@@ -15,14 +15,9 @@
1515
"@babel/core": "^7.4.3",
1616
"@babel/preset-typescript": "^7.3.3",
1717
"@babel/runtime": "^7.4.3",
18-
"@types/jest": "^24.0.11",
1918
"@types/react-native": "^0.57.45",
20-
"@types/react-test-renderer": "^16.8.1",
21-
"babel-jest": "^24.7.1",
2219
"babel-plugin-module-resolver": "^3.2.0",
23-
"jest": "^24.7.1",
2420
"metro-react-native-babel-preset": "^0.53.1",
25-
"react-test-renderer": "16.8.6",
2621
"typescript": "^3.4.3"
2722
}
2823
}

0 commit comments

Comments
 (0)