1
0
Fork 0
Browse Source

test: set up test infrastructure

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
main
André Jaenisch 11 months ago
parent
commit
06769a8255
Signed by: ryuno-ki
GPG Key ID: 5A668E771F1ED854
  1. 7
      .mocharc.cjs
  2. 20
      .nycrc.json
  3. 9837
      package-lock.json
  4. 10
      package.json
  5. 3
      src/index.js
  6. 9
      test/index.test.js

7
.mocharc.cjs

@ -0,0 +1,7 @@
'use strict'
module.exports = {
color: true,
recursive: true,
reporter: 'tap',
}

20
.nycrc.json

@ -0,0 +1,20 @@
{
"all": true,
"check-coverage": true,
"per-file": true,
"include": [
"src/**"
],
"exclude": [
".mocharc.cjs",
"test/*.js",
"test/**/*.spec.js"
],
"reporter": [
"lcov",
"html",
"text"
],
"report-dir": "./coverage",
"temp-directory": "./tmp"
}

9837
package-lock.json generated

File diff suppressed because it is too large Load Diff

10
package.json

@ -4,14 +4,16 @@
"description": "The topic in 2021 is SPACE",
"main": "index.js",
"scripts": {
"coverage": "nyc npm run test",
"prepare": "husky install",
"pre-commit": "npm run test",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha"
},
"repository": {
"type": "git",
"url": "ryunoki@jaenis.ch:ryuno-ki/js13kgames-2021.git"
},
"type": "module",
"engines": {
"node": "16.0.0",
"npm": "7.10.0"
@ -20,6 +22,10 @@
"author": "André Jaenisch",
"license": "GPL-3.0-or-later",
"devDependencies": {
"husky": "7.0.1"
"chai": "4.3.4",
"husky": "7.0.1",
"mocha": "9.0.3",
"nyc": "15.1.0",
"tap": "15.0.9"
}
}

3
src/index.js

@ -0,0 +1,3 @@
export function app () {
console.log('Hello world')
}

9
test/index.test.js

@ -0,0 +1,9 @@
import { expect } from 'chai'
import { app } from '../src/index.js'
describe('App', function () {
it('should work', function () {
expect(true).to.equal(true)
})
})
Loading…
Cancel
Save