Fix fiber/record-tests to work on windows (slash differences) #8796
+4
−2
| - const file = path.relative(root, fileResult.testFilePath); | ||
| + const filePath = path.relative(root, fileResult.testFilePath); | ||
| + // on windows, we still want to output forward slashes | ||
| + const unixFilePath = filePath.replace(/\\/g, '/'); |
tomgasson
Jan 14, 2017
•
Contributor
No, that still uses windows slashes
path.normalize('C:\\temp\\\\foo\\bar\\..\\');
// Returns: 'C:\\temp\\foo\\'
| - const file = path.relative(root, fileResult.testFilePath); | ||
| + const filePath = path.relative(root, fileResult.testFilePath); | ||
| + // on windows, we still want to output forward slashes | ||
| + const unixFilePath = filePath.replace(/\\/g, '/'); |
1 check passed
ci/circleci
Your tests passed on CircleCI!
Details
| @@ -106,12 +106,14 @@ function runJest(maxWorkers) { | ||
| function formatResults(runResults, predicate) { | ||
| const formatted = []; | ||
| runResults.testResults.forEach((fileResult) => { | ||
| - const file = path.relative(root, fileResult.testFilePath); | ||
| + const filePath = path.relative(root, fileResult.testFilePath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running record-tests on windows modifies the output due to slash incompatibility.
This change ensures the output is consistent across platforms which is required since the results are committed back to the repo.
Alternatively we could use slash to do this.