Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comparison tests under WSL #1109

Merged
merged 11 commits into from May 27, 2020
1 change: 1 addition & 0 deletions 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
Expand Down
15 changes: 11 additions & 4 deletions test/comparison-tests/create-and-execute-test.js
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a link to the details in watchpack that discuss this? Would be super useful for anyone else taking a look at this.

// 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);

};
}

Expand Down Expand Up @@ -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);
Expand Down