Skip to content

Commit

Permalink
Sanitize flaky test report file names (#37390)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 authored Dec 15, 2021
1 parent 576c891 commit 1d4a7a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/e2e-tests/config/flaky-tests-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
const fs = require( 'fs' ).promises;
const path = require( 'path' );
const { formatResultsErrors } = require( 'jest-message-util' );
const filenamify = require( 'filenamify' );

class FlakyTestsReporter {
constructor( globalConfig, options ) {
Expand Down Expand Up @@ -53,7 +54,7 @@ class FlakyTestsReporter {
);

await fs.writeFile(
`flaky-tests/${ testTitle }.json`,
`flaky-tests/${ filenamify( testTitle ) }.json`,
JSON.stringify( {
title: testTitle,
path: testPath,
Expand Down
1 change: 1 addition & 0 deletions packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@wordpress/url": "file:../url",
"chalk": "^4.0.0",
"expect-puppeteer": "^4.4.0",
"filenamify": "^4.2.0",
"jest-message-util": "^27.0.6",
"lodash": "^4.17.21",
"puppeteer-testing-library": "^0.5.0",
Expand Down

0 comments on commit 1d4a7a5

Please sign in to comment.