forked from FrontendMasters/testing-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kent C. Dodds
committed
Feb 16, 2017
1 parent
65deeca
commit dd6acc3
Showing
8 changed files
with
627 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"presets": [ | ||
"react-app" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// This is a custom Jest transformer turning style imports into empty objects. | ||
// http://facebook.github.io/jest/docs/tutorial-webpack.html | ||
|
||
module.exports = { | ||
process() { | ||
return 'module.exports = {};' | ||
}, | ||
getCacheKey() { | ||
// The output is always the same. | ||
return 'cssTransform' | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const path = require('path') | ||
|
||
// This is a custom Jest transformer turning file imports into filenames. | ||
// http://facebook.github.io/jest/docs/tutorial-webpack.html | ||
|
||
module.exports = { | ||
process(src, filename) { | ||
return `module.exports = ${JSON.stringify(path.basename(filename))};` | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,12 @@ | |
"version": "0.1.0", | ||
"private": true, | ||
"devDependencies": { | ||
"babel-jest": "^18.0.0", | ||
"babel-preset-react-app": "^2.1.0", | ||
"cross-env": "^3.1.4", | ||
"react-scripts": "0.6.1" | ||
"jest": "^18.1.0", | ||
"react-scripts": "0.6.1", | ||
"rimraf": "^2.5.4" | ||
}, | ||
"license": "MIT", | ||
"repository": "[email protected]:kentcdodds/testing-workshop.git", | ||
|
@@ -23,22 +27,30 @@ | |
"scripts": { | ||
"start": "cross-env PORT=8080 react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "cross-env CI=true react-scripts test --coverage", | ||
"test:watch": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject" | ||
"test": "jest --coverage", | ||
"test:watch": "jest --watch", | ||
"postinstall": "rimraf node_modules/eslint" | ||
}, | ||
"author": "Thinkster (https://github.com/gothinkster)", | ||
"jest": { | ||
"testEnvironment": "jest-environment-jsdom", | ||
"transform": { | ||
"^.+\\.js$": "<rootDir>/node_modules/babel-jest", | ||
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js", | ||
"^(?!.*\\.(js|css|json)$)": "<rootDir>/config/jest/fileTransform.js" | ||
}, | ||
"transformIgnorePatterns": [ | ||
"[/\\\\]node_modules[/\\\\].+\\.jsx$" | ||
], | ||
"collectCoverageFrom": [ | ||
"src/**" | ||
], | ||
"coverageThreshold": { | ||
"global": { | ||
"statements": 0.5, | ||
"branches": 3, | ||
"functions": 1, | ||
"lines": 0.5 | ||
"statements": 0, | ||
"branches": 0, | ||
"functions": 0, | ||
"lines": 0 | ||
} | ||
} | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters