Skip to content

Conversation

erikthedeveloper
Copy link
Owner

This is the first step toward #4

Setup minimal test tooling - expect, enzyme, ES6

Update npm test to mocha ./src/**/*.test.js.

  • Run tests once: npm test
  • Run specific tests: npm test -- --grep='some pattern here'
  • Run tests watch: npm test -- --watch

This pattern allows for tests to live directly adjacent to the file under test.
Example:

src/some/path/someModule.js
src/some/path/someModule.test.js

⚠️ babel-core/register is currently available "by coincidence" due to nwb. This
will need to be addressed to stand alone from nwb when nwb is replaced (#2)

1st React component test! MessageDetail (enzyme)

Component: MessageDetail (Tests for MessageDetail.js)

  • renders without exploding
  • links back to the message listing "search" page
  • indicates whether the message is "flagged"
  • toggles "flagged" status when flag button is clicked
  • deletes itself when the "delete" button is clicked

npm test: mocha ./src/**/*.test.js

This pattern allows for tests to live directly adjacent to the file under test.
Example:
```
src/some/path/someModule.js
src/some/path/someModule.test.js
```

:warning: babel-core/register is currently available "by coincidence" due to nwb. This
will need to be addressed to stand alone from nwb when nwb is replaced (#2)
@erikthedeveloper erikthedeveloper merged commit 0a86469 into master May 2, 2016
@erikthedeveloper erikthedeveloper deleted the feature/add-1st-tests-shallow-rendering branch May 2, 2016 12:17
@erikthedeveloper
Copy link
Owner Author

📝 this PR was basically chopped up into some videos. Link the two together!

enzymewarmup_3-lessons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant