Skip to content

Commit

Permalink
add instructions on running individual tests (#6686)
Browse files Browse the repository at this point in the history
  • Loading branch information
mollymerp authored May 17, 2018
1 parent 744adc7 commit 04f5a37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/run-tap
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/usr/bin/env bash
if [ "$#" == 5 ]; then
arg="${@:0:4} ${BASH_ARGV[1]}/${BASH_ARGV[0]}"
else
arg="${@}"
fi

node_modules/.bin/tap --node-arg -r --node-arg @mapbox/flow-remove-types/register --node-arg -r --node-arg @std/esm ${@}
node_modules/.bin/tap --node-arg -r --node-arg @mapbox/flow-remove-types/register --node-arg -r --node-arg @std/esm $arg
5 changes: 5 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ There are two test suites associated with Mapbox GL JS
- `yarn test` runs quick unit tests
- `yarn run test-suite` runs slower integration tests

To run individual tests:

- Unit tests: `yarn test-unit path/to/file.test.js` where the path begins within the `/test/unit/` directory
- Render tests: `yarn test-render render-test-name`

## Writing Unit Tests

- **You must not share variables between test cases.** All test fixtures must be wrapped in `create` functions. This ensures each test is run in an isolated environment.
Expand Down

0 comments on commit 04f5a37

Please sign in to comment.