forked from tools/josh
1
0
Fork 0

Use Mocha+Chai as test framework

This commit is contained in:
Florine W. Dekker 2019-10-31 20:40:51 +01:00
parent 60dd4e188f
commit dfabe2df63
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
5 changed files with 19 additions and 8 deletions

BIN
package-lock.json generated

Binary file not shown.

View File

@ -7,22 +7,28 @@
"type": "git",
"url": "git@git.fwdekker.com:FWDekker/fwdekker.com.git"
},
"private": true,
"scripts": {
"dev": "grunt dev",
"deploy": "grunt deploy",
"test": "echo TODO"
"test": "mocha -r ts-node/register src/**/*.spec.ts"
},
"dependencies": {
"js-cookie": "^2.2.1"
},
"devDependencies": {
"@types/chai": "^4.2.4",
"@types/js-cookie": "^2.2.4",
"@types/mocha": "^5.2.7",
"chai": "^4.2.0",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-webpack": "^3.1.3",
"mocha": "^6.2.2",
"ts-loader": "^6.2.1",
"ts-node": "^8.4.1",
"typescript": "^3.6.4",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"

View File

@ -1,6 +0,0 @@
import test from "ava";
// import {Path} from "./../../build/js/fs.js";
test("paths", t => {
t.is("a", "a", "OH YES");
});

12
src/test/path.spec.ts Normal file
View File

@ -0,0 +1,12 @@
import "mocha";
import {expect} from "chai";
import "../main/js/extensions"
import {Path} from "../main/js/fs";
describe("Hello function", () => {
it("should return hello world", () => {
expect(new Path("/", "/").path).to.equal("/");
});
});

View File

@ -1,6 +1,5 @@
{
"compilerOptions": {
"module": "esnext",
"target": "es2019",
"strict": true,
"rootDir": "./src/main/js/",