change package.json scripts, add different types of test modes

add section to contributing.md about running tests
indiachan-spamvector
Thomas Lynch 2 years ago
parent 8184b212b1
commit ddd49bc36b
  1. 23
      CONTRIBUTING.md
  2. 5
      package.json

@ -31,5 +31,28 @@ Read the code to understand, but basically:
* TAB for indentation.
* Please include comments.
## Running tests
Make sure these still pass after your changes, or adjust them to meet the new expected results.
There is a "jschan-test" service in the `docker-compose.yml` file that will run all the tests in a jschan instance using the docker instance. See the advanced section of installation for some instruction on how to use this.
You can also Run them locally if you have an instance setup (or for quickly running unit tests):
```bash
#unit tests only
npm run test
# OR npm run test:unit
#integration tests only
npm run test:integration
#all tests
npm run test:all
#specific test(s)
npm run test:all <filename|regex>
```
Thanks,
Tom

@ -56,7 +56,10 @@
"jest": "^27.5.1"
},
"scripts": {
"test": "jest --verbose",
"test": "npm run test:unit",
"test:unit": "jest --verbose --testPathIgnorePatterns=./test/",
"test:integration": "jest --verbose --testPathPattern=./test/",
"test:all": "jest --verbose",
"setup": "npm i -g pm2 gulp && gulp generate-favicon && gulp default",
"start": "pm2 start ecosystem.config.js --env production",
"start-dev": "pm2 start ecosystem.config.js --env development"

Loading…
Cancel
Save