diff --git a/packages/vite/src/node/__tests__/utils.spec.ts b/packages/vite/src/node/__tests__/utils.spec.ts index dbad4cd4afd1a9..34ede1f5be2303 100644 --- a/packages/vite/src/node/__tests__/utils.spec.ts +++ b/packages/vite/src/node/__tests__/utils.spec.ts @@ -18,6 +18,18 @@ describe('injectQuery', () => { 'C:/User/Vite/Project?direct' ) }) + + test('absolute file path', () => { + expect(injectQuery('C:\\test-file.vue', 'direct')).toEqual( + 'C:/test-file.vue?direct' + ) + }) + + test('absolute file path with parameters', () => { + expect( + injectQuery('C:\\test-file.vue?vue&type=template&lang.js', 'direct') + ).toEqual('C:/test-file.vue?direct&vue&type=template&lang.js') + }) } test('relative path', () => {