remove chai from unit tests

This commit is contained in:
Karsten Hassel
2021-06-08 00:47:15 +02:00
parent 66759a33fa
commit 16bbb42b8d
10 changed files with 66 additions and 79 deletions

View File

@@ -1,6 +1,5 @@
const fs = require("fs");
const path = require("path");
const expect = require("chai").expect;
const vm = require("vm");
beforeAll(function () {
@@ -45,20 +44,20 @@ describe("'global.root_path' set in js/app.js", function () {
expectedSubPaths.forEach((subpath) => {
it(`contains a file/folder "${subpath}"`, function () {
expect(fs.existsSync(path.join(sandbox.global.root_path, subpath))).to.equal(true);
expect(fs.existsSync(path.join(sandbox.global.root_path, subpath))).toBe(true);
});
});
it("should not modify global.root_path for testing", function () {
expect(global.root_path).to.equal(undefined);
expect(global.root_path).toBe(undefined);
});
it("should not modify global.version for testing", function () {
expect(global.version).to.equal(undefined);
expect(global.version).toBe(undefined);
});
it("should expect the global.version equals package.json file", function () {
const versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
expect(sandbox.global.version).to.equal(versionPackage);
expect(sandbox.global.version).toBe(versionPackage);
});
});