Skip to content

Commit 13fbd2a

Browse files
committed
jest updated
1 parent ea2ed48 commit 13fbd2a

18 files changed

+615
-5570
lines changed

.github/workflows/nodejs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
run: |
2121
npm ci
2222
npm run build --if-present
23-
npm run test-once
23+
npm run test
2424
env:
2525
CI: true

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
npm run build
2-
npm run test-once
2+
npm run test

jest.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
*/
2626

2727
import type { Config } from 'jest'
28+
// eslint-disable-next-line @typescript-eslint/no-var-requires
29+
const path = require('path')
2830

2931
const config: Config = {
3032
// All imported modules in your tests should be mocked automatically
@@ -167,7 +169,8 @@ const config: Config = {
167169
// snapshotSerializers: [],
168170

169171
// The test environment that will be used for testing
170-
testEnvironment: 'jsdom',
172+
// testEnvironment: 'jsdom',
173+
testEnvironment: path.resolve(__dirname, './jest.environment.js'),
171174

172175
// Options that will be passed to the testEnvironment
173176
// testEnvironmentOptions: {},

jest.environment.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const JSDOMEnvironment = require('jest-environment-jsdom').default
2+
3+
module.exports = class JSDOMEnvironmentGlobal extends JSDOMEnvironment {
4+
constructor(...args) {
5+
super(...args)
6+
// this.global.jsdom = this.dom
7+
this.global.fetch = fetch
8+
}
9+
}

karma.conf.js

-71
This file was deleted.

0 commit comments

Comments
 (0)