Skip to content

Commit

Permalink
Widget: fixes for Chai (ESM)
Browse files Browse the repository at this point in the history
  • Loading branch information
gusthoff committed Nov 2, 2024
1 parent 211c053 commit 8e13d09
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
5 changes: 3 additions & 2 deletions frontend/tests/ts/areas.spec.ts
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
5 changes: 2 additions & 3 deletions frontend/tests/ts/dom-utils.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 4 additions & 2 deletions frontend/tests/ts/download.spec.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/ts/editor.spec.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/ts/scrolltop.spec.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
7 changes: 4 additions & 3 deletions frontend/tests/ts/server.spec.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
7 changes: 4 additions & 3 deletions frontend/tests/ts/widget.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 8e13d09

Please sign in to comment.