Skip to content

Commit 35f07f4

Browse files
Copilotnikku
andcommitted
chore: migrate to chai@6 following established pattern
* explicitly depend on chai and sinon where needed * wire both together using a globals.js file that is imported with the bundle * workaround tree-shaking so it is not accidentally optimized away Co-authored-by: nikku <[email protected]>
1 parent 9193b5c commit 35f07f4

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

karma.conf.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module.exports = function(karma) {
2323

2424
frameworks: [
2525
'mocha',
26-
'sinon-chai',
2726
'webpack'
2827
],
2928

@@ -48,6 +47,10 @@ module.exports = function(karma) {
4847
mode: 'development',
4948
module: {
5049
rules: [
50+
{
51+
test: /test\/globals\.js$/,
52+
sideEffects: true
53+
},
5154
{
5255
test: /\.bpmnlintrc$/,
5356
use: 'bpmnlint-loader'

test/globals.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {
2+
use
3+
} from 'chai';
4+
5+
import sinonChai from 'sinon-chai';
6+
7+
use(sinonChai);

test/suite.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import './globals';
2+
13
var allTests = require.context('.', true, /spec\/.*Spec\.js$/);
24

35
allTests.keys().forEach(allTests);

0 commit comments

Comments
 (0)