-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow configuring options for setup test env #1657
feat: allow configuring options for setup test env #1657
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 2 small changes, the rest LGTM
setup-jest.js
Outdated
@@ -5,23 +5,36 @@ const { | |||
platformBrowserDynamicTesting, | |||
} = require('@angular/platform-browser-dynamic/testing'); | |||
|
|||
let teardown = globalThis.ngJest?.teardown; | |||
let testEnvironmentOptions = globalThis.ngJest?.testEnvironmentOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let testEnvironmentOptions = globalThis.ngJest?.testEnvironmentOptions; | |
let testEnvironmentOptions = globalThis.ngJest?.testEnvironmentOptions ?? Object.create(null); |
setup-jest.mjs
Outdated
@@ -2,22 +2,36 @@ import 'zone.js/fesm2015/zone-testing-bundle.min.js'; | |||
import { getTestBed } from '@angular/core/testing'; | |||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; | |||
|
|||
let teardown = globalThis.ngJest?.teardown; | |||
const configuredDestroyAfterEach = globalThis.ngJest?.destroyAfterEach; | |||
let testEnvironmentOptions = globalThis.ngJest?.testEnvironmentOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as the one in setup-jest.js
a20e695
to
35fc752
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Summary
Users can configure all TestEnvironmentOptions via globalThis in the setup Jest file.
closes #1656
Test plan
Does this PR introduce a breaking change?
Other information
N.A.