Skip to content

Commit

Permalink
add docs for browser testing
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
kkaefer committed Jan 31, 2020
1 parent f47d5e9 commit f9a9ecb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ See [`test/integration/README.md`](https://github.com/mapbox/mapbox-gl-js/blob/m
- **You must not make network requests in test cases.** This rule holds in cases when result isn't used or is expected to fail. You may use `window.useFakeXMLHttpRequest` and `window.server` per the [Sinon API](http://sinonjs.org/docs/#server) to simulate network requests. This ensures that tests are reliable, able to be run in an isolated environment, and performant.
- **You should use clear [input space partitioning](http://crystal.uta.edu/~ylei/cse4321/data/isp.pdf) schemes.** Look for edge cases! This ensures that tests suites are comprehensive and easy to understand.

## Browser Tests

See [`test/browser/README.md`](https://github.com/mapbox/mapbox-gl-js/blob/master/test/browser/README.md).

## Spies, Stubs, and Mocks

The test object is augmented with methods from Sinon.js for [spies](http://sinonjs.org/docs/#spies), [stubs](http://sinonjs.org/docs/#stubs), and [mocks](http://sinonjs.org/docs/#mocks). For example, to use Sinon's spy API, call `t.spy(...)` within a test.
Expand Down

0 comments on commit f9a9ecb

Please sign in to comment.