-
Notifications
You must be signed in to change notification settings - Fork 134
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
🧪 Ensure skipped test do not fail #2821
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
@@ -0,0 +1,20 @@ | |||
function KarmaSkippedFailedReporter(baseReporterDecorator, logger) { |
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.
👏 praise: Great!
if (isIE()) { | ||
return | ||
} | ||
|
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.
💬 suggestion: Instead of duplicating the condition in afterEach (which is error-prone, as it can be forgotten), you could leverage registerCleanupTask
in beforeEach
and remove the afterEach
usage. For example, in this test, we could write:
beforeEach(() => {
if (isIE()) {
pending('no fetch support')
}
fetchStubManager = stubFetch()
originalFetchStub = window.fetch
requests = []
requestsTrackingSubscription = initFetchObservable().subscribe((context) => {
if (context.state === 'resolve') {
requests.push(context)
}
})
fetchStub = window.fetch as FetchStub
registerCleanupTask(() => {
requestsTrackingSubscription.unsubscribe()
fetchStubManager.reset()
})
})
This could be a step toward https://datadoghq.atlassian.net/browse/RUM-5101
Motivation
Some of our tests are skipped but have runtime issues. Jasmine considers them as skipped but DD Test Visibility as failed.
Changes
Ensuring that we do not execute the body of
afterEach
if we skipped the test inbeforeEach
.Adding a Karma reporter to warn when we have failed skipped tests.
Testing
Test Visibility
I have gone over the contributing documentation.