File tree Expand file tree Collapse file tree
packages/tools/src/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,6 +146,32 @@ Done in 171ms using pnpm v10.16.1
146146 } ) ;
147147 } ) ;
148148
149+ test ( 'normalize vitest RUN line with Windows absolute path' , ( ) => {
150+ const output = ' RUN C:/Users/RUNNER~1/AppData/Local/Temp/vite-plus-test-abc/my-test\n' ;
151+ expect ( replaceUnstableOutput ( output ) ) . toBe ( ' RUN <cwd>\n' ) ;
152+ } ) ;
153+
154+ test ( 'normalize vitest RUN line with Windows backslash path' , ( ) => {
155+ const output = ' RUN C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\vite-plus-test-abc\\my-test\n' ;
156+ expect ( replaceUnstableOutput ( output ) ) . toBe ( ' RUN <cwd>\n' ) ;
157+ } ) ;
158+
159+ test ( 'normalize vitest RUN line with version and Windows path' , ( ) => {
160+ const output = ' RUN v1.0.0 C:/Users/RUNNER~1/AppData/Local/Temp/vite-plus-test-abc/my-test\n' ;
161+ expect ( replaceUnstableOutput ( output ) ) . toBe ( ' RUN v<semver> <cwd>\n' ) ;
162+ } ) ;
163+
164+ test ( 'preserve vitest RUN line already normalized with <cwd>' , ( ) => {
165+ const output = ' RUN <cwd>\n' ;
166+ expect ( replaceUnstableOutput ( output ) ) . toBe ( ' RUN <cwd>\n' ) ;
167+ } ) ;
168+
169+ test . skipIf ( process . platform === 'win32' ) ( 'normalize vitest RUN line with cwd on Unix' , ( ) => {
170+ const cwd = '/tmp/vite-plus-test-abc/my-test' ;
171+ const output = ` RUN ${ cwd } \n` ;
172+ expect ( replaceUnstableOutput ( output , cwd ) ) . toBe ( ' RUN <cwd>\n' ) ;
173+ } ) ;
174+
149175 test ( 'replace tsdown output' , ( ) => {
150176 const output = `
151177ℹ tsdown v0.15.1 powered by rolldown v0.15.1
You can’t perform that action at this time.
0 commit comments