Skip to content

Commit 52823ca

Browse files
committed
move extras docs into API section
1 parent 7127273 commit 52823ca

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ beforeEach(() => {
4242
// you get fresh mini-app running in each test
4343
```
4444

45+
### Extras
46+
47+
* Mounted component's actions object is attached to the global `Cypress` variable.
48+
* The `mount` function adds an action `_getState` to the `actions` object, if there is not one already present. This allows you to get the current state of the component for inspection.
49+
50+
```js
51+
Cypress.main.setName('Joe')
52+
expect(Cypress.main._getState().name).to.equal('Joe')
53+
```
54+
4555
## Use
4656

4757
In your Cypress spec files (the example below is from file [cypress/integration/hello-world-spec.js](cypress/integration/hello-world-spec.js)) mount the application, just like you would "normally".
@@ -95,16 +105,6 @@ See video of tests running on CI on the project's [Cypress Dashboard][cypress da
95105
* `npm run cy:open` starts Cypress GUI, which is great for TDD mode
96106
* `npm run cy:run` runs Cypress headlessly, testing all specs. Same command [runs on CI](.travis.yml) with additional `--record` argument to record the run and send to the [Cypress Dashboard][cypress dashboard url]
97107
98-
## Extras
99-
100-
* Mounted component's actions object is attached to the global `Cypress` variable.
101-
* The `mount` function adds an action `_getState` to the `actions` object, if there is not one already present. This allows you to get the current state of the component for inspection.
102-
103-
```js
104-
Cypress.main.setName('Joe')
105-
expect(Cypress.main._getState().name).to.equal('Joe')
106-
```
107-
108108
### Small print
109109
110110
Author: Gleb Bahmutov <[email protected]> © 2017

0 commit comments

Comments
 (0)