mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
Add to CONTRIBUTING doc
This commit is contained in:
parent
e44813b65d
commit
5cd72860e3
@ -123,3 +123,46 @@ rules:
|
||||
_danielyxie/bitburner_ and the base is _dev_.
|
||||
- Do not check in any generated files under `doc\`. The documentation is built
|
||||
automatically by ReadTheDocs.
|
||||
|
||||
## Tests
|
||||
|
||||
There are a few unit tests written using [jest](https://jestjs.io/), and some browser automation tests using [Cypress](https://www.cypress.io/).
|
||||
|
||||
### Unit Tests
|
||||
|
||||
Run unit tests with:
|
||||
|
||||
```sh
|
||||
$ npm run test
|
||||
$ npm run test:watch # to re-run tests on changes
|
||||
```
|
||||
|
||||
Tests go in the `/test` directory.
|
||||
|
||||
### Browser Tests
|
||||
|
||||
There are full browser automation tests which cover some basic "does it work" functionality.
|
||||
|
||||
Run these with:
|
||||
|
||||
```sh
|
||||
$ npm run build
|
||||
$ npm run cy:test
|
||||
```
|
||||
|
||||
To start up the tests in watch mode (re-run on changes), which will also start up a dev server:
|
||||
|
||||
```sh
|
||||
$ npm run cy:dev
|
||||
```
|
||||
|
||||
## TypeScript Setup
|
||||
|
||||
This project uses [Project References](https://www.typescriptlang.org/docs/handbook/project-references.html)
|
||||
to make sure that jest and Cypress tests only exist within Jest/Cypress code.
|
||||
|
||||
To type-check the whole project:
|
||||
|
||||
```sh
|
||||
$ npm run typescript
|
||||
```
|
||||
|
@ -137,6 +137,7 @@
|
||||
"lint": "npm run lint:jsts & npm run lint:style",
|
||||
"lint:jsts": "eslint --fix . --ext js,jsx,ts,tsx",
|
||||
"lint:style": "stylelint --fix ./css/*",
|
||||
"typescript": "tsc --build",
|
||||
"preinstall": "node ./scripts/engines-check.js",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
|
Loading…
Reference in New Issue
Block a user