Skip to content

Commit

Permalink
Try fix windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Apr 2, 2024
1 parent cf6eaf5 commit ac02905
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions packages/tsc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ export function run() {
ts,
id => id,
fileName => {
const rootFileNames = options.rootNames.map(rootName => rootName.replace(windowsPathReg, '/'));
if (options.host?.useCaseSensitiveFileNames?.()) {
return options.rootNames.includes(fileName) ?? false;
return rootFileNames.includes(fileName);
}
else {
const lowerFileName = fileName.toLowerCase();
for (const rootFile of options.rootNames) {
if (rootFile.toLowerCase() === lowerFileName) {
for (const rootFileName of rootFileNames) {
if (rootFileName.toLowerCase() === lowerFileName) {
return true;
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/tsc/tests/dts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ describe('vue-tsc-dts', () => {
ts,
id => id,
fileName => {
const rootFileNames = options.rootNames.map(rootName => rootName.replace(windowsPathReg, '/'));
if (options.host?.useCaseSensitiveFileNames?.()) {
return options.rootNames.includes(fileName) ?? false;
return rootFileNames.includes(fileName);
}
else {
const lowerFileName = fileName.toLowerCase();
for (const rootFile of options.rootNames) {
if (rootFile.toLowerCase() === lowerFileName) {
for (const rootFileName of rootFileNames) {
if (rootFileName.toLowerCase() === lowerFileName) {
return true;
}
}
Expand Down

0 comments on commit ac02905

Please sign in to comment.