Add test and coverage sections

This commit is contained in:
Daniel García Aubert 2019-11-29 13:19:47 +01:00
parent 8523f835dc
commit d3f0c52474
2 changed files with 13 additions and 1 deletions

View File

@ -53,6 +53,18 @@ $ node app.js <env>
Where `<env>` is the name of a configuration file under `./config/environments/`.
### Test
```shell
$ npm test
```
### Coverage
```shell
$ npm run cover
```
## Documentation
You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones.

View File

@ -85,7 +85,7 @@
"test": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit",
"posttest": "npm run test:teardown",
"test:teardown": "NODE_ENV=test node test teardown",
"test:coverage": "npm run test:setup && nyc --reporter=lcov mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit && npm run test:teardown",
"cover": "npm run test:setup && nyc --reporter=lcov mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit && npm run test:teardown",
"pretest:ci": "cp config/environments/test.js.example config/environments/test.js",
"test:ci": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash docker/scripts/test-setup.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v",
"docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash"