@samitouri / QOS-React-2 / commits / c77632791f

Fix fiber/record-tests to work on windows (slash differences) (#8796)

Tom Gasson committed Jan 15, 2017 at 14:16 UTC c77632791f4ce1a56b5727a44e2e2b580ac4736b
1 file changed +4 -2
scripts/fiber/record-tests
+4 -2
@@ -106,12 +106,14 @@ function runJest(maxWorkers) {
106 function formatResults(runResults, predicate) {
107 const formatted = [];
108 runResults.testResults.forEach((fileResult) => {
109 - const file = path.relative(root, fileResult.testFilePath);
109 + const filePath = path.relative(root, fileResult.testFilePath);
110 + // on windows, we still want to output forward slashes
111 + const unixFilePath = filePath.replace(/\\/g, '/');
112 const tests = fileResult.testResults.filter(
113 (test) => predicate(fileResult, test)
114 );
115 if (tests.length) {
114 - const lines = [file].concat(tests.map((test) => '* ' + test.title));
116 + const lines = [unixFilePath].concat(tests.map((test) => '* ' + test.title));
117 formatted.push(lines.join('\n'));
118 }
119 });