Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 10, 2024
1 parent 1e910e1 commit 8c4576a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@
You can run all tests using `npm run all-test`. However, you will very likely only ever need
`npm run api-test` and `npm run ui-test`.

API tests check the generated code and are located in `tests/test-js/api.js`.
API tests check the generated code and are located in `tools/api.js`.

UI tests check the output of a given `.goml` script. They are used to check whether or not a command
is failing and eventually to check what it prints on the console. They are located in
`tests/ui-tests`.
`tests/ui`.

The other tests are checks for the framework's code itself:
* To check that there is no documentation missing for a command, there is `npm run doc-test`.
* To run eslint on the code there is `npm run lint`.
* To ensure that the `.goml` parser is doing what's expected, there is `npm run parser-test`.
* To check that the exported API is doing what's expected, there is `npm run exported-test`.

For `ui` tests, you can filter which ones you want to run by passing the test name as argument:

```
$ npm run ui-test debug.goml debug2.goml
```

## Add, extend or update command

If you want to add a new command or extend/update an existing command, you will need to update
Expand All @@ -29,7 +35,7 @@ Once done, you can generate the `.json` file by using `npm run api-test --bless`
generated output files to ensure it is generating the expected code. Don't forget to check each
variant of the command!

For UI tests, better to add a new `.goml` file into `tests/ui-tests` if you add a new command.
For UI tests, better to add a new `.goml` file into `tests/ui` if you add a new command.
Otherwise, just update an existing one which checks this command in particular. As for what to add
in the file: check it fails when it's supposed to and works when it's supposed to. Check all
variants as well.
Expand Down

0 comments on commit 8c4576a

Please sign in to comment.