From f7c41be679e8806a3ad8b7be05209cff6fac3c83 Mon Sep 17 00:00:00 2001 From: yzydeveloper Date: Fri, 21 Oct 2022 01:08:10 +0800 Subject: [PATCH] test: add absolute file path test --- packages/vite/src/node/__tests__/utils.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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', () => {