diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3f541bb..767d920a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 +``` + Thanks, Tom diff --git a/package.json b/package.json index 5519bf89..4484d8fa 100644 --- a/package.json +++ b/package.json @@ -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"