Skip to content

Commit

Permalink
test: resolve issues with virtual file system running on Windows plat…
Browse files Browse the repository at this point in the history
…forms detecting a case insensitive OS when memfs is always case sensitive
  • Loading branch information
wessberg committed Aug 4, 2023
1 parent 351bf26 commit 45aeda6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
node: [16.14.0, 17, 18, 19, 20]
node: [16.14.0, 18, 20]

steps:
- name: Checkout code
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
node: [16.14.0, 17, 18, 19, 20]
node: [16.15.1, 18, 20]

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion src/service/cache/resolve-cache/resolve-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class ResolveCache {
}

// Resolve the file via Typescript, either through classic or node module resolution
const {resolvedModule} = this.resolveModuleName(typescript, id, parent, compilerOptions, moduleResolutionHost) as {
const {resolvedModule} = this.resolveModuleName(typescript, id, path.normalize(parent), compilerOptions, moduleResolutionHost) as {
resolvedModule: ExtendedResolvedModule | undefined;
};

Expand Down
5 changes: 0 additions & 5 deletions test/util/create-typescript-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function createTypeScriptSystem({
executingFileName = path.urlToFilename(executingFileName);
const typescript = _typescript as TSExtended;
const wildcardCharCodes = [42, 63];
const platform = os.platform();
const byteOrderMarkIndicator = "\uFEFF";

function statSync(p: string) {
Expand Down Expand Up @@ -124,10 +123,6 @@ export function createTypeScriptSystem({
* Taken directly from TypeScript internals
*/
function isFileSystemCaseSensitive() {
// win32\win64 are case insensitive platforms
if (platform === "win32") {
return false;
}
// If this file exists under a different case, we must be case-insensitive.
return !fileExists(swapCase(executingFileName));
}
Expand Down

0 comments on commit 45aeda6

Please sign in to comment.