diff --git a/frontend/tests/ts/areas.spec.ts b/frontend/tests/ts/areas.spec.ts index 8dcd1bbc0..84f59a247 100644 --- a/frontend/tests/ts/areas.spec.ts +++ b/frontend/tests/ts/areas.spec.ts @@ -1,7 +1,8 @@ // Import testing libs -import chai, {expect} from 'chai'; +import { expect, use } from 'chai'; import chaiDom from 'chai-dom'; -chai.use(chaiDom); + +const chai = use(chaiDom); // Import package under test import {Area, OutputArea, LabArea, makeLabArea, LabContainer} diff --git a/frontend/tests/ts/dom-utils.spec.ts b/frontend/tests/ts/dom-utils.spec.ts index af7f477c5..ead4604a5 100644 --- a/frontend/tests/ts/dom-utils.spec.ts +++ b/frontend/tests/ts/dom-utils.spec.ts @@ -1,8 +1,7 @@ // Import testing libs -import chai, {expect} from 'chai'; +import { expect, use } from 'chai'; import chaiDom from 'chai-dom'; - -chai.use(chaiDom); +const chai = use(chaiDom); import {getElemById, getElemsByClass, getElemsByTag} from '../../src/ts/dom-utils.ts'; diff --git a/frontend/tests/ts/download.spec.ts b/frontend/tests/ts/download.spec.ts index 3044353a0..88993ae6a 100644 --- a/frontend/tests/ts/download.spec.ts +++ b/frontend/tests/ts/download.spec.ts @@ -1,6 +1,8 @@ -import chai, {expect} from 'chai'; +import { expect, use } from 'chai'; +import chaiDom from 'chai-dom'; import chaiAsPromised from 'chai-as-promised'; -chai.use(chaiAsPromised); + +const chai = use(chaiDom); import { getLanguages, diff --git a/frontend/tests/ts/editor.spec.ts b/frontend/tests/ts/editor.spec.ts index c6a95abde..1345e8996 100644 --- a/frontend/tests/ts/editor.spec.ts +++ b/frontend/tests/ts/editor.spec.ts @@ -1,8 +1,8 @@ // Import testing libs -import chai, {expect} from 'chai'; +import { expect, use } from 'chai'; import chaiDom from 'chai-dom'; -chai.use(chaiDom); +const chai = use(chaiDom); import ace from 'brace'; diff --git a/frontend/tests/ts/scrolltop.spec.ts b/frontend/tests/ts/scrolltop.spec.ts index 13db18ce9..e533229b3 100644 --- a/frontend/tests/ts/scrolltop.spec.ts +++ b/frontend/tests/ts/scrolltop.spec.ts @@ -1,8 +1,8 @@ // Import testing libs -import chai, {expect} from 'chai'; +import { expect, use } from 'chai'; import chaiDom from 'chai-dom'; -chai.use(chaiDom); +const chai = use(chaiDom); import {scrollTop} from '../../src/ts/scrolltop.ts'; diff --git a/frontend/tests/ts/server.spec.ts b/frontend/tests/ts/server.spec.ts index b20a2d382..cfe2bb44e 100644 --- a/frontend/tests/ts/server.spec.ts +++ b/frontend/tests/ts/server.spec.ts @@ -1,7 +1,8 @@ // Import testing libs -import chai, {expect} from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -chai.use(chaiAsPromised); +import { expect, use } from 'chai'; +import chaiDom from 'chai-dom'; + +const chai = use(chaiDom); import {Server, WebSocket} from 'mock-socket'; diff --git a/frontend/tests/ts/widget.spec.ts b/frontend/tests/ts/widget.spec.ts index 410284219..16472308e 100644 --- a/frontend/tests/ts/widget.spec.ts +++ b/frontend/tests/ts/widget.spec.ts @@ -1,10 +1,11 @@ // Import testing libs -import chai, {expect} from 'chai'; +import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import chaiDom from 'chai-dom'; import {Client, Server, WebSocket} from 'mock-socket'; -chai.use(chaiDom); -chai.use(chaiAsPromised); + +// const chai = use(chaiDom); +const chai = use(chaiAsPromised); import {readFileSync} from 'fs'; import {resolve} from 'path';