unit tests

This commit is contained in:
Karsten Hassel
2021-06-06 23:13:09 +02:00
parent 32df76bdff
commit 66759a33fa
12 changed files with 78 additions and 50 deletions

View File

@@ -7,7 +7,7 @@ describe("File js/class", function () {
let clone;
let dom;
before(function (done) {
beforeAll(function (done) {
dom = new JSDOM(
`<script>var Log = {log: function() {}};</script>\
<script src="file://${path.join(__dirname, "..", "..", "..", "js", "class.js")}">`,
@@ -87,14 +87,14 @@ describe("File js/class", function () {
describe("Test lockstring code", function () {
let log;
before(function () {
beforeAll(function () {
log = dom.window.Log.log;
dom.window.Log.log = function cmp(str) {
expect(str).to.equal("lockStrings");
};
});
after(function () {
afterAll(function () {
dom.window.Log.log = log;
});