Skip to content

Commit

Permalink
tests(styled-components-native): fix settings
Browse files Browse the repository at this point in the history
  • Loading branch information
igorwessel committed Aug 21, 2022
1 parent febf07c commit df24a9f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 21 deletions.
45 changes: 34 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
module.exports = {
testEnvironment: 'jsdom',
transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*@xstyled.*).*$'],
transform: {
'^.+\\.(j|t)sx?$': 'babel-jest',
},
testPathIgnorePatterns: ['/node_modules/', '/website/'],
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleNameMapper: {
'styled-components':
'<rootDir>/node_modules/styled-components/dist/styled-components.browser.cjs.js',
},
projects: [
{
displayName: 'web',
testEnvironment: 'jsdom',
transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*@xstyled.*).*$'],
transform: {
'^.+\\.(j|t)sx?$': 'babel-jest',
},
testPathIgnorePatterns: [
'/node_modules/',
'/website/',
'/packages/styled-components-native/',
],
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleNameMapper: {
'styled-components':
'<rootDir>/node_modules/styled-components/dist/styled-components.browser.cjs.js',
},
},
{
displayName: 'native',
preset: 'react-native',
transformIgnorePatterns: ['node_modules/(?!@react-native|react-native)'],
transform: {
'^.+\\.(j|t)sx?$': 'babel-jest',
},
testPathIgnorePatterns: [
'/node_modules/',
'/website/',
'/packages/(?!styled-components-native)',
],
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
},
],
}
3 changes: 3 additions & 0 deletions packages/styled-components-native/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["module:metro-react-native-babel-preset"]
}
9 changes: 0 additions & 9 deletions packages/styled-components-native/jest.config.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion packages/styled-components-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"scripts": {
"reset": "rm -rf dist",
"build": "../../node_modules/.bin/rollup -c ../../build/rollup.config.js",
"prepublishOnly": "npm run reset && npm run build"
"prepublishOnly": "npm run reset && npm run build",
"test": "jest"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit df24a9f

Please sign in to comment.