Skip to content

Commit 1e31055

Browse files
author
Kent C. Dodds
committed
fix(build output): ensure we exclude tests from the build output
This also updates all packages etc.
1 parent 1e75de1 commit 1e31055

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

jest.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ const {
77

88
module.exports = {
99
collectCoverageFrom,
10-
coveragePathIgnorePatterns,
10+
coveragePathIgnorePatterns: [
11+
...coveragePathIgnorePatterns,
12+
'/__tests__/',
13+
'/__node_tests__/',
14+
],
1115
coverageThreshold,
1216
watchPlugins: [
1317
...watchPlugins,

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"node": ">=8"
2525
},
2626
"scripts": {
27-
"build": "kcd-scripts build && kcd-scripts build --bundle --no-clean",
27+
"build": "kcd-scripts build --ignore \"**/__tests__/**,**/__node_tests__/**,**/__mocks__/**\" && kcd-scripts build --bundle --no-clean",
2828
"lint": "kcd-scripts lint",
2929
"test": "kcd-scripts test",
3030
"test:update": "npm test -- --updateSnapshot --coverage",
@@ -50,13 +50,13 @@
5050
"wait-for-expect": "^1.2.0"
5151
},
5252
"devDependencies": {
53-
"dtslint": "^0.7.7",
54-
"jest-dom": "^3.4.0",
53+
"@testing-library/jest-dom": "^4.0.0",
54+
"dtslint": "^0.8.0",
5555
"jest-in-case": "^1.0.2",
5656
"jest-serializer-ansi": "^1.0.3",
5757
"jest-watch-select-projects": "^0.1.1",
5858
"jsdom": "^15.1.1",
59-
"kcd-scripts": "^1.4.0"
59+
"kcd-scripts": "^1.5.2"
6060
},
6161
"eslintConfig": {
6262
"extends": "./node_modules/kcd-scripts/eslint.js",

src/__tests__/element-queries.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,5 +800,3 @@ test('get/query textarea element by current value', () => {
800800
expect(getByDisplayValue('World').id).toEqual('content-textarea')
801801
expect(queryByDisplayValue('World').id).toEqual('content-textarea')
802802
})
803-
804-
/* eslint jsx-a11y/label-has-for:0 */

tests/jest.config.dom.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@ module.exports = {
55
...baseConfig,
66
rootDir: path.join(__dirname, '..'),
77
displayName: 'dom',
8+
coveragePathIgnorePatterns: [
9+
...baseConfig.coveragePathIgnorePatterns,
10+
'/__tests__/',
11+
'/__node_tests__/',
12+
],
813
testEnvironment: 'jest-environment-jsdom',
914
}

tests/jest.config.node.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,10 @@ module.exports = {
66
rootDir: path.join(__dirname, '..'),
77
displayName: 'node',
88
testEnvironment: 'jest-environment-node',
9+
coveragePathIgnorePatterns: [
10+
...baseConfig.coveragePathIgnorePatterns,
11+
'/__tests__/',
12+
'/__node_tests__/',
13+
],
914
testMatch: ['**/__node_tests__/**.js'],
1015
}

tests/setup-env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'jest-dom/extend-expect'
1+
import '@testing-library/jest-dom/extend-expect'
22
import jestSerializerAnsi from 'jest-serializer-ansi'
33

44
expect.addSnapshotSerializer(jestSerializerAnsi)

0 commit comments

Comments
 (0)