Skip to content

Commit

Permalink
Test Harness Refactor (#514)
Browse files Browse the repository at this point in the history
chore: adding mocha configuration file
chore: adding missing require statement in test file
chore: renaming test files to include the .spec ext
chore: adding c8 to dev dependencies
chore: refactoring scripts section in package.json
  • Loading branch information
mcknasty committed Jan 20, 2024
1 parent bf3073b commit f115bff
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 58 deletions.
16 changes: 16 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
process.env.TS_NODE_SKIP_PROJECT = true

const config = {
"diff": true,
"extension": ["*"],
"package": "./package.json",
"reporter": "spec",
"slow": 1000,
"timeout": 10000,
"ui": "bdd",
"watch-files": ["./test/*.spec.js"],
"node-option": ["max-old-space-size=5120"],
"jobs": 30
}

module.exports = config
158 changes: 104 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"url": "git@github.com:bcoe/c8.git"
},
"scripts": {
"test": "cross-env TS_NODE_SKIP_PROJECT=true node ./bin/c8.js mocha --timeout=10000 ./test/*.js",
"coverage": "cross-env TS_NODE_SKIP_PROJECT=true node ./bin/c8.js --check-coverage mocha --timeout=10000 ./test/*.js",
"test": "c8 mocha ./test/*.spec.js",
"coverage": "c8 --check-coverage mocha ./test/*.spec.js",
"test:snap": "cross-env CHAI_JEST_SNAPSHOT_UPDATE_ALL=true npm test",
"fix": "standard --fix",
"posttest": "standard"
Expand Down Expand Up @@ -47,6 +47,7 @@
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^9.1.0",
"chai": "^4.3.6",
"chai-jest-snapshot": "^2.0.0",
"cross-env": "^7.0.3",
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions test/integration.js.snap → test/integration.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ hey
---------------------------------------|---------|----------|---------|---------|------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------------------------------|---------|----------|---------|---------|------------------------
All files | 3.52 | 12.5 | 6.52 | 3.52 |
All files | 3.49 | 12.24 | 6.38 | 3.49 |
c8 | 0 | 0 | 0 | 0 |
.mocharc.js | 0 | 0 | 0 | 0 | 1-16
index.js | 0 | 0 | 0 | 0 | 1
c8/bin | 0 | 0 | 0 | 0 |
c8.js | 0 | 0 | 0 | 0 | 1-43
Expand Down Expand Up @@ -521,8 +522,9 @@ hey
---------------------------------------|---------|----------|---------|---------|------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------------------------------|---------|----------|---------|---------|------------------------
All files | 3.52 | 12.5 | 6.52 | 3.52 |
All files | 3.49 | 12.24 | 6.38 | 3.49 |
c8 | 0 | 0 | 0 | 0 |
.mocharc.js | 0 | 0 | 0 | 0 | 1-16
index.js | 0 | 0 | 0 | 0 | 1
c8/bin | 0 | 0 | 0 | 0 |
c8.js | 0 | 0 | 0 | 0 | 1-43
Expand Down
1 change: 1 addition & 0 deletions test/parse-args.js → test/parse-args.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
} = require('../lib/parse-args')

const { join, resolve } = require('path')
require('chai').should()

describe('parse-args', () => {
describe('hideInstrumenteeArgs', () => {
Expand Down
File renamed without changes.

0 comments on commit f115bff

Please sign in to comment.