diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ebeff967..44198ccf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## v7.0.5 +* [Add a delay before starting the comparison tests to avoid failures under WSL](https://github.com/TypeStrong/ts-loader/pull/1109) - thanks @appzuka * [Apply other loaders when updating files in watch mode](https://github.com/TypeStrong/ts-loader/pull/1115) - thanks @iorate ## v7.0.4 diff --git a/test/comparison-tests/create-and-execute-test.js b/test/comparison-tests/create-and-execute-test.js index 09839de3d..c3b355a22 100644 --- a/test/comparison-tests/create-and-execute-test.js +++ b/test/comparison-tests/create-and-execute-test.js @@ -109,10 +109,16 @@ function createTest(test, testPath, options) { mkdirp.sync(paths.actualOutput); mkdirp.sync(paths.webpackOutput); - // execute webpack - testState.watcher = webpack( - createWebpackConfig(paths, options, nonWatchNonCompositePath !== testPath) - ).watch({ aggregateTimeout: 1500 }, createWebpackWatchHandler(done, paths, testState, options, test)); + + // Need to wait > FS_ACCURACY as defined in watchpack. + // See PR 1109 for details: https://github.com/TypeStrong/ts-loader/pull/1109 + setTimeout(() => { + // execute webpack + testState.watcher = webpack( + createWebpackConfig(paths, options, nonWatchNonCompositePath !== testPath) + ).watch({ aggregateTimeout: 1500 }, createWebpackWatchHandler(done, paths, testState, options, test)); + }, 200); + }; } @@ -275,6 +281,7 @@ function copyPatchOrEndTest(testStagingPath, watcher, testState, done) { if (fs.existsSync(patchPath)) { testState.iteration++; // can get inconsistent results if copying right away + // Probably due to the reaons in PR 1109: https://github.com/TypeStrong/ts-loader/pull/1109 setTimeout(function () { copySync(patchPath, testStagingPath); }, 1000);