diff --git a/build/run-tap b/build/run-tap index 92b6f94387a..18dd26cd29c 100755 --- a/build/run-tap +++ b/build/run-tap @@ -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 diff --git a/test/README.md b/test/README.md index 9a73b1be096..f76c4692731 100644 --- a/test/README.md +++ b/test/README.md @@ -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.