admin管理员组文章数量:1023827
I am using detox as the end-2-end tester for my react-native app but I don't want whats in the e2e folder to be included when I run npm test. I am currently using jest for the npm test.
This is what i have in my package.json:
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!(react-native|static-container|expo|@expo|react-navigation))"
]
},
The e2e folder is located in my root directory and my test files are in my tests folder in the root directory also.
I am using detox as the end-2-end tester for my react-native app but I don't want whats in the e2e folder to be included when I run npm test. I am currently using jest for the npm test.
This is what i have in my package.json:
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!(react-native|static-container|expo|@expo|react-navigation))"
]
},
The e2e folder is located in my root directory and my test files are in my tests folder in the root directory also.
Share Improve this question edited Feb 28, 2019 at 14:31 skyboyer 23.8k7 gold badges62 silver badges71 bronze badges asked Feb 28, 2019 at 14:14 Liam RamsbottomLiam Ramsbottom 1874 silver badges15 bronze badges1 Answer
Reset to default 7To get around this problem when I run my jest tests I use the testMatch property and set it in the package.json
this means that it will only match the tests that are in the folders that I have specified.
"jest": {
"preset": "react-native",
"testMatch": [
"<rootDir>/__tests__/**/*.test.js?(x)",
"<rootDir>/app/**/*.test.js"
]
},
Alternatively you can use to ignore specific paths.
"jest": {
"preset": "react-native",
"testPathIgnorePatterns": [
"<rootDir>/e2e"
]
},
I am using detox as the end-2-end tester for my react-native app but I don't want whats in the e2e folder to be included when I run npm test. I am currently using jest for the npm test.
This is what i have in my package.json:
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!(react-native|static-container|expo|@expo|react-navigation))"
]
},
The e2e folder is located in my root directory and my test files are in my tests folder in the root directory also.
I am using detox as the end-2-end tester for my react-native app but I don't want whats in the e2e folder to be included when I run npm test. I am currently using jest for the npm test.
This is what i have in my package.json:
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!(react-native|static-container|expo|@expo|react-navigation))"
]
},
The e2e folder is located in my root directory and my test files are in my tests folder in the root directory also.
Share Improve this question edited Feb 28, 2019 at 14:31 skyboyer 23.8k7 gold badges62 silver badges71 bronze badges asked Feb 28, 2019 at 14:14 Liam RamsbottomLiam Ramsbottom 1874 silver badges15 bronze badges1 Answer
Reset to default 7To get around this problem when I run my jest tests I use the testMatch property and set it in the package.json
this means that it will only match the tests that are in the folders that I have specified.
"jest": {
"preset": "react-native",
"testMatch": [
"<rootDir>/__tests__/**/*.test.js?(x)",
"<rootDir>/app/**/*.test.js"
]
},
Alternatively you can use to ignore specific paths.
"jest": {
"preset": "react-native",
"testPathIgnorePatterns": [
"<rootDir>/e2e"
]
},
本文标签: javascriptIgnore e2e folder when running npm testStack Overflow
版权声明:本文标题:javascript - Ignore e2e folder when running npm test - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745528772a2154652.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论