Skip to content

Commit df24a9f

Browse files
committed
tests(styled-components-native): fix settings
1 parent febf07c commit df24a9f

File tree

4 files changed

+39
-21
lines changed

4 files changed

+39
-21
lines changed

jest.config.js

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
module.exports = {
2-
testEnvironment: 'jsdom',
3-
transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*@xstyled.*).*$'],
4-
transform: {
5-
'^.+\\.(j|t)sx?$': 'babel-jest',
6-
},
7-
testPathIgnorePatterns: ['/node_modules/', '/website/'],
8-
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
9-
moduleNameMapper: {
10-
'styled-components':
11-
'<rootDir>/node_modules/styled-components/dist/styled-components.browser.cjs.js',
12-
},
2+
projects: [
3+
{
4+
displayName: 'web',
5+
testEnvironment: 'jsdom',
6+
transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*@xstyled.*).*$'],
7+
transform: {
8+
'^.+\\.(j|t)sx?$': 'babel-jest',
9+
},
10+
testPathIgnorePatterns: [
11+
'/node_modules/',
12+
'/website/',
13+
'/packages/styled-components-native/',
14+
],
15+
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
16+
moduleNameMapper: {
17+
'styled-components':
18+
'<rootDir>/node_modules/styled-components/dist/styled-components.browser.cjs.js',
19+
},
20+
},
21+
{
22+
displayName: 'native',
23+
preset: 'react-native',
24+
transformIgnorePatterns: ['node_modules/(?!@react-native|react-native)'],
25+
transform: {
26+
'^.+\\.(j|t)sx?$': 'babel-jest',
27+
},
28+
testPathIgnorePatterns: [
29+
'/node_modules/',
30+
'/website/',
31+
'/packages/(?!styled-components-native)',
32+
],
33+
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
34+
},
35+
],
1336
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["module:metro-react-native-babel-preset"]
3+
}

packages/styled-components-native/jest.config.cjs

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/styled-components-native/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"scripts": {
2727
"reset": "rm -rf dist",
2828
"build": "../../node_modules/.bin/rollup -c ../../build/rollup.config.js",
29-
"prepublishOnly": "npm run reset && npm run build"
29+
"prepublishOnly": "npm run reset && npm run build",
30+
"test": "jest"
3031
},
3132
"publishConfig": {
3233
"access": "public"

0 commit comments

Comments
 (0)