Skip to content

Commit

Permalink
fix(build output): ensure we exclude tests from the build output
Browse files Browse the repository at this point in the history
This also updates all packages etc.
  • Loading branch information
Kent C. Dodds committed Jul 12, 2019
1 parent 1e75de1 commit 1e31055
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ const {

module.exports = {
collectCoverageFrom,
coveragePathIgnorePatterns,
coveragePathIgnorePatterns: [
...coveragePathIgnorePatterns,
'/__tests__/',
'/__node_tests__/',
],
coverageThreshold,
watchPlugins: [
...watchPlugins,
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"node": ">=8"
},
"scripts": {
"build": "kcd-scripts build && kcd-scripts build --bundle --no-clean",
"build": "kcd-scripts build --ignore \"**/__tests__/**,**/__node_tests__/**,**/__mocks__/**\" && kcd-scripts build --bundle --no-clean",
"lint": "kcd-scripts lint",
"test": "kcd-scripts test",
"test:update": "npm test -- --updateSnapshot --coverage",
Expand All @@ -50,13 +50,13 @@
"wait-for-expect": "^1.2.0"
},
"devDependencies": {
"dtslint": "^0.7.7",
"jest-dom": "^3.4.0",
"@testing-library/jest-dom": "^4.0.0",
"dtslint": "^0.8.0",
"jest-in-case": "^1.0.2",
"jest-serializer-ansi": "^1.0.3",
"jest-watch-select-projects": "^0.1.1",
"jsdom": "^15.1.1",
"kcd-scripts": "^1.4.0"
"kcd-scripts": "^1.5.2"
},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js",
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/element-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,5 +800,3 @@ test('get/query textarea element by current value', () => {
expect(getByDisplayValue('World').id).toEqual('content-textarea')
expect(queryByDisplayValue('World').id).toEqual('content-textarea')
})

/* eslint jsx-a11y/label-has-for:0 */
5 changes: 5 additions & 0 deletions tests/jest.config.dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ module.exports = {
...baseConfig,
rootDir: path.join(__dirname, '..'),
displayName: 'dom',
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
'/__tests__/',
'/__node_tests__/',
],
testEnvironment: 'jest-environment-jsdom',
}
5 changes: 5 additions & 0 deletions tests/jest.config.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ module.exports = {
rootDir: path.join(__dirname, '..'),
displayName: 'node',
testEnvironment: 'jest-environment-node',
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
'/__tests__/',
'/__node_tests__/',
],
testMatch: ['**/__node_tests__/**.js'],
}
2 changes: 1 addition & 1 deletion tests/setup-env.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest-dom/extend-expect'
import '@testing-library/jest-dom/extend-expect'
import jestSerializerAnsi from 'jest-serializer-ansi'

expect.addSnapshotSerializer(jestSerializerAnsi)

0 comments on commit 1e31055

Please sign in to comment.