Skip to content

Commit

Permalink
test(e2e): fix image display in the report built on windows (#2720)
Browse files Browse the repository at this point in the history
Fixes `\` in windows path strings preventing the correct computation of
relative paths.
  • Loading branch information
brendanlaschke authored Jun 1, 2023
1 parent 52cfdbc commit f076ee5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/config/jest.image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const toMatchImageSnapshotWithRealSignature = toMatchImageSnapshot as (received:

// The path is relative from the jest-html-reporters page to the folder storing the images
function computeRelativePathFromReportToSnapshots(path: string): string {
path = path.replace(/\\/g, '/');
const searchedPart = 'build/test-report/e2e/'; // hard coded here, must be kept in sync with the e2e/jest.config.js
return './' + path.substring(path.indexOf(searchedPart) + searchedPart.length);
}
Expand Down

0 comments on commit f076ee5

Please sign in to comment.