Skip to content

Commit

Permalink
Upgrade Jest and Webpack
Browse files Browse the repository at this point in the history
Mostly based on changes made in the original NHS app: nhsuk/cookie-consent@ed071c0
  • Loading branch information
jdudley1123 committed Oct 8, 2024
1 parent 1b6af4f commit 7cc56eb
Show file tree
Hide file tree
Showing 10 changed files with 15,710 additions and 29,958 deletions.
9 changes: 5 additions & 4 deletions cookie-test-environment.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const JSDOMEnvironment = require('jest-environment-jsdom');
import JSDOMEnvironment from 'jest-environment-jsdom';

module.exports = class CookieTestEnvironment extends JSDOMEnvironment {
constructor(config) {
super(config);
export default class CookieTestEnvironment extends JSDOMEnvironment {
constructor(config, options) {
super(config, options);
this.global.jsdom = this.dom;
this.global.cookieJar = this.dom.cookieJar;
}

Expand Down
8 changes: 3 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ module.exports = {
testEnvironment: './cookie-test-environment.js',
testEnvironmentOptions: {
cookieJar: new jsdom.CookieJar(),
// Set a url with a path so we can write cookie tests that use paths.
url: 'http://localhost/path1/path2/path3/'

Check failure on line 14 in jest.config.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma
},
testMatch: [
'<rootDir>/src/*.test.js',
],
// Set a url with a path so we can write cookie tests that use paths.
testURL: 'http://localhost/path1/path2/path3/',
testMatch: ['<rootDir>/src/*.test.js'],
};
Loading

0 comments on commit 7cc56eb

Please sign in to comment.