Skip to content

Commit

Permalink
Fix windows snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
machty committed Jun 22, 2024
1 parent fcc2294 commit 5403c12
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test-packages/test-utils/src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ import { WorkspaceSymbolRequest, WorkspaceSymbolParams } from '@volar/language-s

const require = createRequire(import.meta.url);
const dirname = path.dirname(fileURLToPath(import.meta.url));
const pathToTemplatePackage = pathUtils.normalizeFilePath(
path.resolve(dirname, '../../../packages/template'),
const fileUriToTemplatePackage = pathUtils.filePathToUri(
path.resolve(dirname, '../../../packages/template').replace(':', '%3A') // encode windows drive `:` colon
);
const fileUriToTemplatePackage = pathUtils.filePathToUri(pathToTemplatePackage);
const ROOT = pathUtils.normalizeFilePath(path.resolve(dirname, '../../ephemeral'));

// You'd think this would exist, but... no? Accordingly, supply a minimal
Expand Down Expand Up @@ -160,8 +159,9 @@ export class Project {
volarEmbeddedContentUri.toString(),
`volar-embedded-content://URI_ENCODED_PATH_TO/FILE`,
)
.replaceAll(this.filePath('.'), '/path/to/EPHEMERAL_TEST_PROJECT')
.replaceAll(fileUriToTemplatePackage, 'file:///PATH_TO_MODULE/@glint/template');
.replaceAll(this.filePath('.').replace(':', '%3A'), '/path/to/EPHEMERAL_TEST_PROJECT')
.replaceAll(fileUriToTemplatePackage, 'file:///PATH_TO_MODULE/@glint/template')
.replaceAll('file:////', 'file:///');

return JSON.parse(normalized);
}
Expand Down

0 comments on commit 5403c12

Please sign in to comment.