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
Apr 21, 2017
1 parent
f8c7862
commit feb622c
Showing
17 changed files
with
188 additions
and
12 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 |
---|---|---|
|
@@ -11,3 +11,4 @@ npm-debug.log* | |
cypress/videos | ||
cypress/screenshots | ||
dist | ||
.opt-in |
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,65 @@ | ||
# Instructions | ||
|
||
> This is a work in progress, but I think it'll be much easier for you to know what to do to have it written out! | ||
## API Unit Tests | ||
|
||
- Run `npm start api.unit` to run the tests in watch mode | ||
- Relevant files: | ||
- You'll write your tests in: `api/src/routes/__tests__/utils.js` | ||
- The source code you're testing is: `api/src/routes/utils.js` | ||
- The demo is in: `api-final/demo/unit/` | ||
- The solution is in: `api-final/src/routes/` | ||
|
||
### TDD a new feature | ||
|
||
Setup is the same as above! | ||
|
||
> Remember to write a simple test to cover a simple use case. Then write code | ||
> to make that test pass. Then refactor your code to clean it up if needed. Then | ||
> continue the cycle until you cover all use cases. | ||
### Fix the bug | ||
|
||
- Run `npm start api.unit` to run the tests in watch mode | ||
- Relevant files: | ||
- You'll write your tests in: `api/src/models/__tests__/user.js` | ||
- The bug is in: `api/src/models/user.js` | ||
- The solution is in: `api-final/src/models/` | ||
|
||
> Remember to first find the bug, reproduce it with a test, then fix the bug. | ||
> That order is important! | ||
## API Integration Tests | ||
|
||
- Run `npm start api.integration` to run the tests in watch mode | ||
- Relevant files: | ||
- You'll write your tests in: `api/tests/integration/articles.test.js` | ||
- The article's routes are defined in: `api/src/routes/api/articles.js` | ||
- The demo is in: `api-final/demo/integration/` | ||
- The solution is in: `api-final/tests/integration/` | ||
|
||
## Client Unit Tests | ||
|
||
- Run `npm start client.unit` to run the tests in watch mode | ||
- Relevant files: | ||
- You'll write your tests in: `src/reducers/__tests__/` and `src/screens/__tests__` | ||
- The source code you're testing is next to those folders. | ||
- The demo is in: `client-final/demo/unit/` | ||
- The solution is in: `client-final/tests/unit/` | ||
|
||
## Client Integration Tests | ||
|
||
- Run `npm start client.integration` to run the tests in watch mode | ||
- Relevant files: | ||
- You'll write your tests in: `client/tests/integration/login.test.js` | ||
- The login component is: `client/src/screens/login.js` | ||
- The demo is: `client-final/tests/integration/register.test.js` | ||
- The solution is: `client-final/tests/integration/login.test.js` | ||
|
||
## End to End Tests | ||
|
||
- Run `npm start e2e.dev` to run the tests in dev mode | ||
- Relevant files: | ||
- You'll write your tests in: `cypress/e2e/users_spec.js` | ||
- You may find: `cypress/e2e/utils.js` useful |
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 @@ | ||
// FINAL_START | ||
{ | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"no-unused-vars": "off", | ||
|
||
} | ||
} | ||
// FINAL_END |
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 @@ | ||
// FINAL_START | ||
{ | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"no-unused-vars": "off", | ||
|
||
} | ||
} | ||
// FINAL_END |
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 @@ | ||
// FINAL_START | ||
{ | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"no-unused-vars": "off", | ||
|
||
} | ||
} | ||
// FINAL_END |
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 @@ | ||
// FINAL_START | ||
{ | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"no-unused-vars": "off", | ||
|
||
} | ||
} | ||
// FINAL_END |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
"globals": { | ||
"cy": false, | ||
"Cypress": false, | ||
} | ||
} | ||
}, | ||
} |
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
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 @@ | ||
// FINAL_START | ||
{ | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"no-unused-vars": "off", | ||
|
||
} | ||
} | ||
// FINAL_END |
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 @@ | ||
// FINAL_START | ||
{ | ||
"rules": { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"no-unused-vars": "off", | ||
|
||
} | ||
} | ||
// FINAL_END |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1152,7 +1152,7 @@ [email protected]: | |
version "2.6.0" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" | ||
|
||
commander@^2.8.1: | ||
commander@2.9.0, commander@^2.8.1: | ||
version "2.9.0" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" | ||
dependencies: | ||
|
@@ -2773,6 +2773,10 @@ locate-path@^2.0.0: | |
p-locate "^2.0.0" | ||
path-exists "^3.0.0" | ||
|
||
lodash._baseclone@~4.5.0: | ||
version "4.5.7" | ||
resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz#ce42ade08384ef5d62fa77c30f61a46e686f8434" | ||
|
||
lodash._baseget@^3.0.0: | ||
version "3.7.2" | ||
resolved "https://registry.yarnpkg.com/lodash._baseget/-/lodash._baseget-3.7.2.tgz#1b6ae1d5facf3c25532350a13c1197cb8bb674f4" | ||
|
@@ -2787,6 +2791,12 @@ lodash.assign@^4.0.3, lodash.assign@^4.0.6: | |
version "4.2.0" | ||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" | ||
|
||
[email protected]: | ||
version "4.3.2" | ||
resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.3.2.tgz#e56b176b6823a7dde38f7f2bf58de7d5971200e9" | ||
dependencies: | ||
lodash._baseclone "~4.5.0" | ||
|
||
lodash.cond@^4.3.0: | ||
version "4.5.2" | ||
resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" | ||
|
@@ -2863,7 +2873,7 @@ make-plural@~3.0.6: | |
optionalDependencies: | ||
minimist "^1.2.0" | ||
|
||
manage-path@^2.0.0: | ||
manage-path@2.0.0, manage-path@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/manage-path/-/manage-path-2.0.0.tgz#f4cf8457b926eeee2a83b173501414bc76eb9597" | ||
|
||
|
@@ -3225,6 +3235,15 @@ opn@^4.0.0: | |
object-assign "^4.0.1" | ||
pinkie-promise "^2.0.0" | ||
|
||
opt-cli@^1.5.1: | ||
version "1.5.1" | ||
resolved "https://registry.yarnpkg.com/opt-cli/-/opt-cli-1.5.1.tgz#04db447b13c96b992eb31685266f4ed0d9736dc2" | ||
dependencies: | ||
commander "2.9.0" | ||
lodash.clone "4.3.2" | ||
manage-path "2.0.0" | ||
spawn-command "0.0.2-1" | ||
|
||
optionator@^0.8.2: | ||
version "0.8.2" | ||
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" | ||
|
@@ -3938,6 +3957,10 @@ spawn-command-with-kill@^1.0.0: | |
ps-tree "^1.1.0" | ||
spawn-command "^0.0.2-1" | ||
|
||
[email protected]: | ||
version "0.0.2-1" | ||
resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" | ||
|
||
spawn-command@^0.0.2-1: | ||
version "0.0.2" | ||
resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" | ||
|