Skip to content

Commit 196f36c

Browse files
committed
Migrate test runner from Mocha/Chai to Vitest
- Replace mocha/chai with vitest for simpler test configuration - Remove jsdom window setup and jQuery initialization boilerplate - Add vitest.config.mjs with jsdom environment configuration
1 parent 6c22adf commit 196f36c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

test/test.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import { expect } from 'chai';
2-
import { JSDOM } from 'jsdom';
31
import jquery from 'jquery';
42
import param from 'jquery-param';
53

64
describe('equivalence', function () {
7-
var $ = jquery(new JSDOM().window),
5+
var $ = jquery,
86
test = function (obj) {
97
expect(decodeURIComponent(param(obj))).to.equal(decodeURIComponent($.param(obj)));
108
};

vitest.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
environment: 'jsdom',
6+
globals: true,
7+
include: ['test/**/*.mjs'],
8+
},
9+
});

0 commit comments

Comments
 (0)