Merge pull request #111 from cse110-fa22-group29/try-nyc

Implement c8 Code Coverage Testing
This commit is contained in:
Arthur Lu 2022-12-04 22:44:17 -08:00 committed by GitHub
commit 2640b10a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -22,8 +22,8 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
run: sudo npm install run: npm install
- name: Start local http server - name: Start local http server
run: sudo npm run http-server & run: npm run http-server &
- name: Run tests - name: Run tests with coverage
run: sudo npm test run: npm run coverage

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
**/.devcontainer/* **/.devcontainer/*
**/node_modules/* **/node_modules/*
**/package-lock.json **/package-lock.json
**/*.vscode/* **/.vscode/*
**/.nyc_output/*
**/coverage/*

View File

@ -4,6 +4,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "mocha --recursive --require mock-local-storage './{,!(node_modules)/**}/*.test.js'", "test": "mocha --recursive --require mock-local-storage './{,!(node_modules)/**}/*.test.js'",
"coverage": "c8 --check-coverage --lines 90 --functions 90 --branches 90 npm run test",
"lint-js": "eslint **/*.js", "lint-js": "eslint **/*.js",
"fix-js": "eslint --fix **/*.js", "fix-js": "eslint --fix **/*.js",
"lint-html": "htmlhint **/*.html", "lint-html": "htmlhint **/*.html",
@ -15,6 +16,7 @@
"js-doc": "jsdoc -d source/docs/ -r source/" "js-doc": "jsdoc -d source/docs/ -r source/"
}, },
"devDependencies": { "devDependencies": {
"c8": "^7.12.0",
"eslint": "^8.27.0", "eslint": "^8.27.0",
"htmlhint": "1.1.4", "htmlhint": "1.1.4",
"http-server": "", "http-server": "",