-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: stabilize e2e tests on windows
- Loading branch information
1 parent
6052b66
commit 25e1e54
Showing
18 changed files
with
210 additions
and
855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import webpack from 'webpack'; | ||
import path from 'path'; | ||
import { getWatcher } from './getWatcher'; | ||
|
||
function getChangedFiles(compiler: webpack.Compiler): string[] { | ||
let changedFiles: string[] = []; | ||
|
||
if ((compiler as any).modifiedFiles) { | ||
// webpack 5+ | ||
return Array.from((compiler as any).modifiedFiles); | ||
changedFiles = Array.from((compiler as any).modifiedFiles); | ||
} else { | ||
const watcher = getWatcher(compiler); | ||
// webpack 4 | ||
return Object.keys((watcher && watcher.mtimes) || {}); | ||
changedFiles = Object.keys((watcher && watcher.mtimes) || {}); | ||
} | ||
|
||
return ( | ||
changedFiles | ||
// normalize paths | ||
.map((changedFile) => path.normalize(changedFile)) | ||
// check if path is inside the context to filer-out some trash from fs | ||
.filter( | ||
(changedFile) => | ||
!compiler.options.context || | ||
changedFile.startsWith(path.normalize(compiler.options.context)) | ||
) | ||
); | ||
} | ||
|
||
export { getChangedFiles }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import webpack from 'webpack'; | ||
import path from 'path'; | ||
import { ForkTsCheckerWebpackPluginState } from '../ForkTsCheckerWebpackPluginState'; | ||
|
||
function getDeletedFiles( | ||
compiler: webpack.Compiler, | ||
state: ForkTsCheckerWebpackPluginState | ||
): string[] { | ||
let deletedFiles: string[] = []; | ||
|
||
if ((compiler as any).removedFiles) { | ||
// webpack 5+ | ||
return Array.from((compiler as any).removedFiles || []); | ||
deletedFiles = Array.from((compiler as any).removedFiles || []); | ||
} else { | ||
// webpack 4 | ||
return [...state.removedFiles]; | ||
deletedFiles = [...state.removedFiles]; | ||
} | ||
|
||
return ( | ||
deletedFiles | ||
// normalize paths | ||
.map((changedFile) => path.normalize(changedFile)) | ||
// check if path is inside the context to filer-out some trash from fs | ||
.filter( | ||
(changedFile) => | ||
!compiler.options.context || | ||
changedFile.startsWith(path.normalize(compiler.options.context)) | ||
) | ||
); | ||
} | ||
|
||
export { getDeletedFiles }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.