Skip to content

Commit 9a37b8e

Browse files
Merge pull request #1234 from oliver-sanders/readme
readme++
2 parents 04c3ae8 + 86b40d4 commit 9a37b8e

File tree

1 file changed

+76
-72
lines changed

1 file changed

+76
-72
lines changed

README.md

Lines changed: 76 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,83 @@ PARTICULAR PURPOSE. See the GNU General Public License for more details.
2424
You should have received a copy of the GNU General Public License along with
2525
Cylc. If not, see [GNU licenses](http://www.gnu.org/licenses/).
2626

27-
## Developers
27+
## Development
2828

29-
### Building
29+
### Install & Build
30+
31+
```bash
32+
# Project setup
33+
yarn install
34+
35+
# build & run in offline mode (uses mock data, auto-reloads the browser on change)
36+
yarn run serve
37+
38+
# build for development (rebuilds on change)
39+
# launch using `cylc gui --ui-build-dir=<path>`
40+
# (where path is the path to the `dist/` folder created by build
41+
yarn run build:watch
42+
43+
# build for production
44+
yarn run build
45+
46+
# Produce build report
47+
yarn run build:report
48+
```
49+
50+
### Tests
51+
52+
There are three groups of tests:
53+
54+
* Unit tests
55+
* Simple unit tests for individual functions and classes.
56+
* **Framework:** Mocha
57+
* **Assertions:** Chai
58+
* **Path:** `tests/unit`
59+
* **Command:** `yarn run test:unit`
60+
* (To watch add `--watch`)
61+
* Component tests
62+
* In-browser tests which mount a single Vue component standalone.
63+
* **Framework:** Cypress
64+
* **Assertions:** Chai
65+
* **Path:** `cypress/component`
66+
* **Command:** `yarn run test:e2e` (navigate to component page)
67+
* (For "headless" mode add `-- --headless --config video=false`)
68+
* End to end tests
69+
* In-browser tests which load entire pages of the UI using mocked data.
70+
* **Framework:** Cypress
71+
* **Assertions:** Chai
72+
* **Path:** `tests/e2e`
73+
* **Command:** `yarn run test:e2e` (navigate to e2e page)
74+
* (For "headless" mode add `-- --headless --config video=false`)
75+
76+
For coverage:
77+
```
78+
yarn run coverage:unit
79+
```
80+
81+
Useful test opts:
82+
- `--bail`: exit after first test failure
83+
- `--colors`: enables coloured output in VSCode integrated terminal
84+
85+
### Mocked Data
86+
87+
The "offline" mode (aka `yarn run serve`) which is also used for the end to end
88+
tests is powered by "mock" data.
89+
90+
You can find the index of mocked data here: `src/services/mock/json/index.js`
91+
92+
Mock data is automatically loaded when the subscription/query issued matches
93+
an entry in that file.
94+
95+
### Code Style
96+
97+
See `.eslintrc.js` for style, to test run:
98+
99+
```
100+
yarn run lint
101+
```
102+
103+
### Project Setup
30104

31105
This project was created with the [vue-cli](https://cli.vuejs.org/).
32106

@@ -111,76 +185,6 @@ module.exports = {
111185
(`.browserslistrc`) to determine the polyfills needed. See
112186
https://cli.vuejs.org/guide/browser-compatibility.html.
113187

114-
#### Project setup
115-
116-
```
117-
yarn install
118-
```
119-
120-
#### Compiles and hot-reloads demo mode for development
121-
122-
```
123-
yarn run serve
124-
```
125-
126-
#### Compiles and minifies for production
127-
128-
```
129-
yarn run build
130-
```
131-
132-
#### Compiles and watch for changes for development
133-
134-
```
135-
yarn run build:watch
136-
```
137-
138-
#### Produce build report
139-
140-
```
141-
yarn run build:report
142-
```
143-
144-
#### Run unit tests
145-
146-
```
147-
yarn run test:unit
148-
```
149-
150-
Useful opts:
151-
- `--watch`: watch for changes (allows re-running tests much quicker)
152-
- `--bail`: exit after first test failure
153-
- `--colors`: enables coloured output in VSCode integrated terminal
154-
155-
For coverage:
156-
```
157-
yarn run coverage:unit
158-
```
159-
160-
#### Run functional tests
161-
162-
```
163-
yarn run test:e2e
164-
```
165-
166-
Or for headless mode
167-
168-
```
169-
yarn run test:e2e -- --headless --config video=false
170-
```
171-
172-
For coverage
173-
174-
```
175-
yarn run coverage:e2e
176-
```
177-
178-
#### Lints and fixes files
179-
180-
```
181-
yarn run lint
182-
```
183-
184188
### Integration with the backend Cylc UI server
185189

186190
In the previous section _"Compiles and watch for changes for development"_,

0 commit comments

Comments
 (0)