Commit dda5d2f8 authored by Lucas BRETTES's avatar Lucas BRETTES
Browse files

chore: switch to jest for testing

parent 5aa6814d
module.exports = {
"roots": [
"<rootDir>/test"
],
"testMatch": [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)"
],
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
}
\ No newline at end of file
This diff is collapsed.
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^12.1.4", "@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4", "@commitlint/config-conventional": "^12.1.4",
"@types/mocha": "^5.2.0", "@types/jest": "^26.0.24",
"husky": "^7.0.1", "husky": "^7.0.1",
"mocha": "^8.2.1", "jest": "^27.0.6",
"ts-node": "^6.0.5", "ts-jest": "^27.0.3",
"typescript": "^2.8.3" "typescript": "^4.3.5"
}, },
"scripts": { "scripts": {
"test": "mocha --require ts-node/register/transpile-only 'test/**/*.ts'", "test": "jest",
"watch": "mocha --require ts-node/register --watch --watch-files src, test/**/*.ts" "watch": "jest --watch --verbose"
}, },
"private": true "private": true
} }
import assert from 'assert'; import assert from 'assert';
import Yatzy from '../src/Yatzy'; import Yatzy from '../src/Yatzy';
describe('Chance', () => { describe('Chance', () => {
it('scores sum of all dice', () => { it('scores sum of all dice', () => {
assert.strictEqual(15, Yatzy.chance(2, 3, 4, 5, 1)); assert.strictEqual(15, Yatzy.chance(2, 3, 4, 5, 1));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"rootDir": ".", "rootDir": ".",
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"types": ["node", "mocha"], "types": ["node", "jest"],
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"esModuleInterop": true "esModuleInterop": true
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment