[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix(vite-node): fix error stack on Windows (#6786)

authored by

Hiroshi Ogawa and committed by
GitHub
(Dec 1, 2024, 11:31 PM +0100) bf7b36ac 98c7e519

+23
+1
packages/vite-node/src/server.ts
··· 190 190 } 191 191 192 192 getSourceMap(source: string) { 193 + source = normalizeModuleId(source) 193 194 const fetchResult = this.fetchCache.get(source)?.result 194 195 if (fetchResult?.map) { 195 196 return fetchResult.map
+6
test/vite-node/test/cli.test.ts
··· 52 52 editFile(entryPath, c => c.replace('test 1', 'test 2')) 53 53 await viteNode.waitForStdout('test 2') 54 54 }) 55 + 56 + it('error stack', async () => { 57 + const entryPath = resolve(__dirname, '../src/watch/source-map.ts') 58 + const { viteNode } = await runViteNodeCli('--watch', entryPath) 59 + await viteNode.waitForStdout('source-map.ts:7:11') 60 + })
+16
test/vite-node/src/watch/source-map.ts
··· 1 + // 1 2 + // 1 3 + async function main() { 4 + try { 5 + // 2 6 + // 2 7 + throw new Error('boom') 8 + } 9 + catch (e) { 10 + // eslint-disable-next-line no-console 11 + console.log(e) 12 + } 13 + } 14 + // 3 15 + // 3 16 + main()