Skip to content

Commit 4b9f45b

Browse files
committed
feat(environment-jsdom): allow passing html content to jsdom environment
1 parent 3a85065 commit 4b9f45b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/jest-environment-jsdom/src

packages/jest-environment-jsdom/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class JSDOMEnvironment implements JestEnvironment<number> {
3131
moduleMocker: ModuleMocker | null;
3232

3333
constructor(config: Config.ProjectConfig, options?: EnvironmentContext) {
34-
this.dom = new JSDOM('<!DOCTYPE html>', {
34+
this.dom = new JSDOM(typeof config.testEnvironmentOptions.html === 'string' ? config.testEnvironmentOptions.html : '<!DOCTYPE html>', {
3535
pretendToBeVisual: true,
3636
resources:
3737
typeof config.testEnvironmentOptions.userAgent === 'string'

0 commit comments

Comments
 (0)