Skip to content

Commit

Permalink
some small documentation fixes (maplibre#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbu42 authored Apr 10, 2022
1 parent 2aa1ca3 commit ba21c20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
4 changes: 0 additions & 4 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ See [`test/integration/README.md`](./integration/README.md).
- **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`](./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
23 changes: 12 additions & 11 deletions test/integration/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
These integration tests verify the correctness and consistency of [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js) and
[mapbox-gl-native](https://github.com/mapbox/mapbox-gl-native) rendering.
These integration tests verify the correctness and consistency of [maplibre-gl-js](https://github.com/maplibre/maplibre-gl-js) and
[maplibre-gl-native](https://github.com/maplibre/maplibre-gl-native) rendering.

## Organization

Tests are contained in a directory tree, generally organized by [style specification](https://github.com/mapbox/mapbox-gl-style-spec)
Tests are contained in a directory tree, generally organized by [style specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/)
property: `background-color`, `line-width`, etc., with a second level of directories below that for individual tests. For example, the test for specifying a literal `circle-radius` value lives in [`test/integration/render/tests/circle-radius/literal/`](./render/tests/circle-radius/literal).

Within a leaf directory is a `style.json` file (e.g. [`circle-radius/literal/style.json`](./render/tests/circle-radius/literal/style.json)), which contains the minimal style needed for the given test case. The style can specify the map size, center, bearing, and pitch, and additional test metadata (e.g. output image dimensions).
Expand All @@ -17,27 +17,28 @@ The contents of vector tile fixtures can be read using the [`vt2geojson`](https:

## Running tests

To run the entire integration test suite (both render or query tests), from within the `mapbox-gl-js` directory run the command:
```
npm run test-suite
```

To run only the render/query tests:
To run the render tests:

```
npm run test-render
```
or

To run the query tests:
```
npm run test-query
```

To run only the expression tests:
To run the expression tests:

```
npm run test-expressions
```

To run the browser tests (see [`browser/README.md`](./browser/README.md)):
```
npm run test-browser
```

### Running specific tests

To run a subset of tests or an individual test, you can pass a specific subdirectory to the `test-render` script. For example, to run all the tests for a given property, e.g. `circle-radius`:
Expand Down

0 comments on commit ba21c20

Please sign in to comment.