update web test-runner and remove temp summaryReporter workaournd (#3320)

* update web test-runner and remove temp summaryReporter workaournd

* Update error reporting to show in context of the test file and as a summary at the bottom
This commit is contained in:
MichaelWest22 2025-05-22 17:17:16 +12:00 committed by GitHub
parent d2e39716fb
commit 083dbcdd6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 15 deletions

8
package-lock.json generated
View File

@ -11,7 +11,7 @@
"devDependencies": {
"@types/node": "20.0.0",
"@types/parse5": "^7.0.0",
"@web/test-runner": "^0.20.1",
"@web/test-runner": "^0.20.2",
"@web/test-runner-playwright": "^0.11.0",
"chai": "^4.5.0",
"chai-dom": "^1.12.1",
@ -1251,9 +1251,9 @@
"dev": true
},
"node_modules/@web/test-runner": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@web/test-runner/-/test-runner-0.20.1.tgz",
"integrity": "sha512-MTN8D1WCeCdkUWJIeG9yauUbRkk9g0zGFnBbI5smtPE91NpXFMfRd8nShIvxQnHx9fNTmK+OCYKnOSlq5DLLVA==",
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@web/test-runner/-/test-runner-0.20.2.tgz",
"integrity": "sha512-zfEGYEDnS0EI8qgoWFjmtkIXhqP15W40NW3dCaKtbxj5eU0a7E53f3GV/tZGD0GlZKF8d4Fyw+AFrwOJU9Z4GA==",
"dev": true,
"dependencies": {
"@web/browser-logs": "^0.4.0",

View File

@ -80,7 +80,7 @@
"devDependencies": {
"@types/node": "20.0.0",
"@types/parse5": "^7.0.0",
"@web/test-runner": "^0.20.1",
"@web/test-runner": "^0.20.2",
"@web/test-runner-playwright": "^0.11.0",
"chai": "^4.5.0",
"chai-dom": "^1.12.1",

View File

@ -1,16 +1,8 @@
import {
summaryReporter,
defaultReporter,
dotReporter
defaultReporter
} from '@web/test-runner'
// There is a bug in the summaryReporter made with this PR https://github.com/modernweb-dev/web/pull/2126
// It captures the buffered logger into cachedLogger for reuse later for the test run finished error reporting
// But the buffered logger in finished its buffer flush before this test error reporting so these logs go nowhere
// to resolve this for now reusing dotReporter which reports errors well but disabled its . test reporting
const errorReporter = dotReporter()
delete errorReporter.reportTestFileResults
const config = {
testRunnerHtml: (testFramework) => `
<html lang="en">
@ -69,7 +61,7 @@ const config = {
'test/attributes/**/*.js',
'test/core/**/*.js'
],
reporters: [summaryReporter({ flatten: false }), errorReporter, defaultReporter({ reportTestProgress: true, reportTestResults: false })]
reporters: [summaryReporter({ flatten: false, reportTestLogs: false, reportTestErrors: true }), defaultReporter({ reportTestProgress: true, reportTestResults: true })]
}
export default config