Skip to content

Commit

Permalink
Downgrade JSDOM for Jest environment to 15
Browse files Browse the repository at this point in the history
Use Jest built-in jsdom environment if jsdom/jsdom#2961 was fixed.
  • Loading branch information
yhatt committed Jun 8, 2020
1 parent d696ce3 commit eb62ad6
Show file tree
Hide file tree
Showing 6 changed files with 420 additions and 32 deletions.
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
collectCoverageFrom: ['src/**/*.{j,t}s'],
coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
coverageThreshold: { global: { lines: 95 } },
globalSetup: '<rootDir>/test/_globalSetup.js',
setupFiles: ['jest-plugin-context/setup'],
testEnvironment: 'node',
testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.[jt]s$',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"codecov": "^3.7.0",
"github-markdown-css": "^4.0.0",
"jest": "^26.0.1",
"jest-environment-jsdom-fifteen": "^1.0.2",
"jest-junit": "^10.0.0",
"jest-plugin-context": "^2.9.0",
"markdown-it": "^11.0.0",
Expand Down
6 changes: 0 additions & 6 deletions test/_globalSetup.js

This file was deleted.

3 changes: 2 additions & 1 deletion test/browser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @jest-environment jsdom */
/** @jest-environment jsdom-fifteen */
// TODO: Use Jest built-in jsdom environment if https://github.com/jsdom/jsdom/issues/2961 was fixed
import browser, { observer } from '../src/browser'
import fittingObserver from '../src/fitting/observer'

Expand Down
3 changes: 2 additions & 1 deletion test/fitting/observer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @jest-environment jsdom */
/** @jest-environment jsdom-fifteen */
// TODO: Use Jest built-in jsdom environment if https://github.com/jsdom/jsdom/issues/2961 was fixed
import Marp from '../../src/marp'
import fittingObserver from '../../src/fitting/observer'

Expand Down

0 comments on commit eb62ad6

Please sign in to comment.