Skip to content

Commit

Permalink
update cypress docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvfritz committed Mar 20, 2018
1 parent 0f858a6 commit 9bdd54f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,18 @@ yarn dev:e2e

### Introduction to Cypress

I recommend checking out our Cypress tests in `tests/e2e/specs`, then reading through [the _Core Concepts_](https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html#Cypress-Is-Simple) in the Cypress docs, which are fantastic. This section will be pretty short, because I can't offer much improvement over what you'll see there.
I recommend checking out our Cypress tests in `tests/e2e/specs`, then reading through at least these sections of the excellent Cypress docs:

* [Core Concepts](https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html#Cypress-Is-Simple)
* [Best Practices](https://docs.cypress.io/guides/references/best-practices.html)

Beyond that, also know that you can access our app in Cypress on the `window`. For example, to dispatch a Vuex action that sets up some state:

```js
cy.window().then(window => {
return window.__app__.$store.dispatch('someModule/someAction')
})
```

## The mock API

Expand All @@ -89,7 +100,7 @@ The mock API is an [Express](https://expressjs.com/) server in `tests/mock-api`

### Testing/developing against a real server

In some situations, you might prefer to test against a local server while developing, or maybe just during continuous integration. To do so, you can run any development or test command with the `API_BASE_URL` environment variable:
In some situations, you might prefer to test against a local server while developing, or maybe just during continuous integration. To do so, you can run any development or test command with the `API_BASE_URL` environment variable. For example:

```sh
API_BASE_URL=http://localhost:3000 yarn test
Expand Down

0 comments on commit 9bdd54f

Please sign in to comment.