A lovely javascript testing framework -- want to contribute? join us in https://gitter.im/mochajs/contributors
juergba on karma
type check before calling retri… (compare)
const assert = require("chai").assert;
const sayHello = require("../app").sayHello;
const addNum = require("../app").addNum;
//const app = require("../app");
describe("App", function() {
it("app should return hello", function() {
assert.equal(sayHello(), "hello");
});
it("app it should be a string", function() {
assert.typeOf(sayHello(), "string");
});
it("should return 15", function() {
assert.equal(addNum(8), "15");
});
it("should be a number", function() {
assert.typeOf(addNum(5), "number");
});
});
const mocha = new Mocha({
reporter: "json"
});
const pathFile = `./test/${title}`;
mocha.addFile(pathFile);
const runner = mocha.run(failures => {
console.log(failures);
if (failures) console.log(true);
});
console.log(runner);