Skip to content

Commit 1dd097d

Browse files
authored
Merge pull request #75 from keithamus/migrate-from-karma-to-wtr
migrate from karma to wtr
2 parents ed36174 + 2676185 commit 1dd097d

10 files changed

+3563
-1665
lines changed

package-lock.json

+3,538-1,622
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-11
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
],
2525
"scripts": {
2626
"build": "tsc --build",
27+
"check": "tsc --noEmit",
2728
"lint": "eslint . --ignore-path .gitignore",
28-
"pretest": "npm run build",
29-
"test": "npm run lint && karma start test/karma.config.cjs",
29+
"pretest": "npm run lint && npm run check",
30+
"test": "wtr",
3031
"prepack": "npm run build",
3132
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'"
3233
},
@@ -36,17 +37,11 @@
3637
"@types/node": "^20.5.7",
3738
"@typescript-eslint/eslint-plugin": "^6.5.0",
3839
"@typescript-eslint/parser": "^6.5.0",
39-
"chai": "^4.3.8",
40-
"chromium": "^3.0.3",
40+
"@web/dev-server-esbuild": "^1.0.4",
41+
"@web/test-runner": "^0.20.0",
42+
"chai": "^5.2.0",
4143
"eslint": "^8.48.0",
4244
"eslint-plugin-github": "^4.10.0",
43-
"karma": "^6.4.2",
44-
"karma-chai": "^0.1.0",
45-
"karma-chai-spies": "^0.1.4",
46-
"karma-chrome-launcher": "^3.2.0",
47-
"karma-mocha": "^2.0.1",
48-
"karma-mocha-reporter": "^2.2.5",
49-
"mocha": "^10.2.0",
5045
"tslib": "^2.6.2",
5146
"typescript": "^5.2.2"
5247
}

test/clipboarditem.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {ClipboardItem, apply, isSupported, isPolyfilled} from '../lib/clipboarditem.js'
1+
import {expect} from 'chai'
2+
import {ClipboardItem, apply, isSupported, isPolyfilled} from '../src/clipboarditem.ts'
23

34
describe('ClipboardItem', () => {
45
it('has standard isSupported, isPolyfilled, apply API', () => {

test/element-checkvisibility.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {apply, isPolyfilled, isSupported, checkVisibility} from '../lib/element-checkvisibility.js'
1+
import {expect} from 'chai'
2+
import {apply, isPolyfilled, isSupported, checkVisibility} from '../src/element-checkvisibility.ts'
23

34
describe('checkVisibility', () => {
45
it('has standard isSupported, isPolyfilled, apply API', () => {

test/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {apply, isPolyfilled, isSupported} from '../lib/index.js'
1+
import {expect} from 'chai'
2+
import {apply, isPolyfilled, isSupported} from '../src/index.ts'
23

34
describe('abortSignalAbort', () => {
45
it('has standard isSupported, isPolyfilled, apply API', () => {

test/karma.config.cjs

-26
This file was deleted.

test/navigator-clipboard.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {clipboardRead, clipboardWrite, apply, isPolyfilled, isSupported} from '../lib/navigator-clipboard.js'
1+
import {expect} from 'chai'
2+
import {clipboardRead, clipboardWrite, apply, isPolyfilled, isSupported} from '../src/navigator-clipboard.ts'
23

34
describe('navigator clipboard', () => {
45
it('has standard isSupported, isPolyfilled, apply API', () => {

test/promise-withResolvers.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {apply, isPolyfilled, isSupported, withResolvers} from '../lib/promise-withResolvers.js'
1+
import {expect} from 'chai'
2+
import {apply, isPolyfilled, isSupported, withResolvers} from '../src/promise-withResolvers.ts'
23

34
describe('withResolvers', () => {
45
it('has standard isSupported, isPolyfilled, apply API', () => {

test/requestidlecallback.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {apply, isPolyfilled, isSupported, requestIdleCallback} from '../lib/requestidlecallback.js'
1+
import {expect} from 'chai'
2+
import {apply, isPolyfilled, isSupported, requestIdleCallback} from '../src/requestidlecallback.ts'
23

34
describe('requestIdleCallback', () => {
45
it('has standard isSupported, isPolyfilled, apply API', () => {

web-test-runner.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {esbuildPlugin} from '@web/dev-server-esbuild'
2+
3+
export default {
4+
files: ['test/*'],
5+
nodeResolve: true,
6+
plugins: [esbuildPlugin({ts: true, target: 'es2020'})],
7+
}

0 commit comments

Comments
 (0)