Skip to content

Commit

Permalink
Add test coverage script to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
replete committed Jun 26, 2024
1 parent 68ed12b commit b13c143
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ node_modules
!.vscode/extensions.json
.DS_Store


# keys/certs for browserSync
*.key
*.crt
*.pem
*.pem

# Tests
coverage/*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ Build script `run.mjs` built with Node 18

### Tests
`npm run test` - Launches pupeeter integration tests in a browser
`npm run coverage` - run jest tests with coverage
Jest is set up with puppeteer to run some integration tests. We're using `@swc/jest`'s rust implementation of jest to speed things up.


Expand Down
1 change: 0 additions & 1 deletion __tests__/integration.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ describe("a fresh instance of biscuitman", () => {
})

test("should hide UI and save consents correctly after selecting some sections", async () => {
console.log(await loadConsents())

await page.click('button[data-id=settings]')
const dialog = await page.$('dialog')
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
"build": "node ./run.js build",
"report": "node ./run.js report",
"test": "node --experimental-vm-modules --disable-warning=ExperimentalWarning ./node_modules/jest/bin/jest.js --runInBand",
"coverage": "node --experimental-vm-modules --disable-warning=ExperimentalWarning ./node_modules/jest/bin/jest.js --runInBand --collectCoverage --",
"makecerts": "mkcert -cert-file server.crt -key-file server.key localhost 127.0.0.1 ::1"
},
"test": "jest --",
"devDependencies": {
"@swc/core": "^1.6.5",
"@swc/jest": "^0.2.36",
Expand Down

0 comments on commit b13c143

Please sign in to comment.