web
web copied to clipboard
fix: do not swallow failing test results in the default reporter
What I did
Fix an issue that leads to failing tests to be potentially swallowed from the defaultReporter import { defaultReporter } from '@web/test-runner';
It's a very tedious issue to debug and might fail tests to fail on CI systems as well as locally.
Reproduceable test
import { readFile } from '@web/test-runner-commands';
import { expect } from '@esm-bundle/chai';
describe('minimal reproducible example', () => {
it('this test works', async () => {
document.body.innerHTML = await readFile({ path: './mocks/just-return-empty-body.html' });
expect(true).to.be.true;
});
describe('this describe fails', async () => {
document.body.innerHTML = await readFile({ path: './mocks/just-return-empty-body-2.html' });
it('failing test', () => {
expect(true).to.be.true;
});
});
});
Output before
Test fails without any logging
Output after
Provide context which test is failing for further debugging
🦋 Changeset detected
Latest commit: 2c8127be2b4257d85a4d471b9819c65a3becbd9a
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @web/test-runner | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR