Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixes #1603 - Updates CONTRIBUTING.md all tests should be run with fi…
…xtures data.
  • Loading branch information
brizental committed Jun 21, 2017
commit ea2976c375b5a83de3b85758c1a2fe6af3be109b
15 changes: 3 additions & 12 deletions docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ If you are a member of webcompat organization in GitHub, edit `config/secrets.py

Change the value to : `ISSUES_REPO_URI = 'webcompat/webcompat-tests/issues'`.

Start the application server:
Start the application server in test mode:

```bash
source env/bin/activate && python run.py
source env/bin/activate && python run.py -t
```
> We start the server in test mode to mock the communications with GitHub API servers using local fixture data. The files in `/tests/fixtures/` directory will be served as responses.

In a separate terminal window or tab, run the tests:

Expand All @@ -77,16 +78,6 @@ To run a single test suite, where foo.js is the file found in the `tests/functio
node_modules/.bin/intern-runner config=tests/intern functionalSuites=tests/functional/foo.js
```

## Functional Tests using Fixture Data

It's possible to mock the communications with GitHub API servers using local fixture data. To run tests using these mocked repsonses, run the server in "test mode":

```bash
python run.py -t
```

You can then run intern tests or do local development and the files in the `/tests/fixtures/` directory will be served as responses.

## Adding Fixtures

To indicate that the app should send fixture data, use the `@mockable_response` decorator for an API endpoint.
Expand Down