Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"https-localhost": "^4.7.1",
"tinyglobby": "catalog:",
"unocss": "catalog:",
"vite": "^6.3.5",
"vite": "catalog:",
"vite-plugin-pwa": "^1.2.0",
"vitepress": "2.0.0-alpha.16",
"vitepress-plugin-group-icons": "^1.7.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"typescript": "^5.9.3",
"unplugin-isolated-decl": "^0.15.7",
"unplugin-oxc": "^0.6.0",
"vite": "8.0.11",
"vite": "catalog:",
"vitest": "workspace:*",
"zx": "^8.8.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mocker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@
"es-module-lexer": "^2.0.0",
"msw": "catalog:",
"pathe": "catalog:",
"vite": "^6.3.5"
"vite": "catalog:"
}
}
389 changes: 212 additions & 177 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ catalog:
tinyspy: ^4.0.4
typescript: ^5.9.3
unocss: ^66.6.6
vite: 8.0.11
vite: 8.1.4
vitest-sonar-reporter: 3.0.0
vue: ^3.5.29
ws: ^8.20.1
Expand Down
38 changes: 19 additions & 19 deletions test/e2e/test/__snapshots__/stacktraces.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ exports[`stacktrace in dependency package > external 1`] = `
Error: __TEST_STACK__
❯ innerTestStack (NODE_MODULES)/@test/test-dep-error/index.js:10:9
❯ testStack (NODE_MODULES)/@test/test-dep-error/index.js:4:3
❯ error-in-package.test.js:8:12
❯ error-in-package.test.js:8:3
6|
7| test('js', () => {
8| testStack()
| ^
| ^
9| })
10|

Expand All @@ -50,19 +50,19 @@ Error: __TEST_STACK_TS__
23| }
24|
❯ testStack (NODE_MODULES)/@test/test-dep-error/ts.ts:12:3
❯ error-in-package.test.js:12:14
❯ error-in-package.test.js:12:3

⎯⎯[2/4]⎯

FAIL error-in-package.test.js > transpiled
Error: __TEST_STACK_TRANSPILED__
❯ innerTestStack (NODE_MODULES)/@test/test-dep-error/transpiled.ts:22:9
❯ testStack (NODE_MODULES)/@test/test-dep-error/transpiled.ts:12:3
❯ error-in-package.test.js:16:22
❯ error-in-package.test.js:16:3
14|
15| test('transpiled', () => {
16| testStackTranspiled()
| ^
| ^
17| })
18|

Expand All @@ -72,11 +72,11 @@ Error: __TEST_STACK_TRANSPILED__
Error: __TEST_STACK_TRANSPILED_INLINE__
❯ innerTestStack (NODE_MODULES)/@test/test-dep-error/transpiled-inline.ts:22:9
❯ testStack (NODE_MODULES)/@test/test-dep-error/transpiled-inline.ts:12:3
❯ error-in-package.test.js:20:28
❯ error-in-package.test.js:20:3
18|
19| test('transpiled inline', () => {
20| testStackTranspiledInline()
| ^
| ^
21| })
22|

Expand All @@ -99,7 +99,7 @@ Error: __TEST_STACK__
11| }
12|
❯ testStack (NODE_MODULES)/@test/test-dep-error/index.js:4:3
❯ error-in-package.test.js:8:12
❯ error-in-package.test.js:8:3

⎯⎯[1/4]⎯

Expand All @@ -113,19 +113,19 @@ Error: __TEST_STACK_TS__
23| }
24|
❯ testStack (NODE_MODULES)/@test/test-dep-error/ts.ts:12:3
❯ error-in-package.test.js:12:14
❯ error-in-package.test.js:12:3

⎯⎯[2/4]⎯

FAIL error-in-package.test.js > transpiled
Error: __TEST_STACK_TRANSPILED__
❯ innerTestStack (NODE_MODULES)/@test/test-dep-error/transpiled.ts:22:9
❯ testStack (NODE_MODULES)/@test/test-dep-error/transpiled.ts:12:3
❯ error-in-package.test.js:16:22
❯ error-in-package.test.js:16:3
14|
15| test('transpiled', () => {
16| testStackTranspiled()
| ^
| ^
17| })
18|

Expand All @@ -135,11 +135,11 @@ Error: __TEST_STACK_TRANSPILED__
Error: __TEST_STACK_TRANSPILED_INLINE__
❯ innerTestStack (NODE_MODULES)/@test/test-dep-error/transpiled-inline.ts:22:9
❯ testStack (NODE_MODULES)/@test/test-dep-error/transpiled-inline.ts:12:3
❯ error-in-package.test.js:20:28
❯ error-in-package.test.js:20:3
18|
19| test('transpiled inline', () => {
20| testStackTranspiledInline()
| ^
| ^
21| })
22|

Expand Down Expand Up @@ -184,7 +184,7 @@ ReferenceError: bar is not defined
| ^
4| }
5|
❯ error-in-deps.test.js:5:6
❯ error-in-deps.test.js:5:3

⎯⎯[1/1]⎯

Expand Down Expand Up @@ -236,19 +236,19 @@ exports[`stacktraces should respect sourcemaps > add-in-js.test.js 1`] = `
`;

exports[`stacktraces should respect sourcemaps > error-in-deps.test.js 1`] = `
" ❯ error-in-deps.test.js:5:6
" ❯ error-in-deps.test.js:5:3

⎯⎯[1/1]⎯

"
`;

exports[`stacktraces should respect sourcemaps > error-in-package.test.js 1`] = `
" ❯ error-in-package.test.js:8:12
" ❯ error-in-package.test.js:8:3
6|
7| test('js', () => {
8| testStack()
| ^
| ^
9| })
10|
"
Expand Down Expand Up @@ -299,11 +299,11 @@ exports[`stacktraces should respect sourcemaps > mocked-imported.test.ts 1`] = `
`;

exports[`stacktraces should respect sourcemaps > require-assertions.test.js 1`] = `
" ❯ require-assertions.test.js:3:5
" ❯ require-assertions.test.js:3:1
1| import { test } from 'vitest'
2|
3| test('assertion is not called', () => {
| ^
| ^
4| // no expect
5| })
"
Expand Down
16 changes: 12 additions & 4 deletions test/e2e/test/stacktraces.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import { resolve } from 'pathe'
import { glob } from 'tinyglobby'
import { version as viteVersion } from 'vite'
import { describe, expect, it } from 'vitest'
import { rolldownVersion } from 'vitest/node'
import { runInlineTests, runVitest } from '../../test-utils'

// To prevent the warning coming up in snapshots
process.setMaxListeners(20)

const isVite7 = viteVersion.startsWith('7.')
const vite8StacktraceFiles = new Set([
'error-in-deps.test.js',
'error-in-package.test.js',
'require-assertions.test.js',
])

describe('stacktraces should respect sourcemaps', async () => {
const root = resolve(import.meta.dirname, '../fixtures/stacktraces')
const files = await glob(['*.test.*'], { cwd: root, expandDirectories: false })

for (const file of files) {
it(file, async () => {
it.skipIf(isVite7 && vite8StacktraceFiles.has(file))(file, async () => {
const { stderr } = await runVitest({ root }, [file])

expect(stderr).toBeTruthy()
Expand Down Expand Up @@ -45,7 +53,7 @@ describe('stacktrace should print error frame source file correctly', async () =
const root = resolve(import.meta.dirname, '../fixtures/stacktraces')
const testFile = resolve(root, './error-in-deps.test.js')

it('error-in-deps', async () => {
it.skipIf(isVite7)('error-in-deps', async () => {
const { stderr } = await runVitest({ root }, [testFile])

// expect to print framestack of foo.js
Expand All @@ -71,14 +79,14 @@ describe('stacktrace in dependency package', () => {
const root = resolve(import.meta.dirname, '../fixtures/stacktraces')
const testFile = resolve(root, './error-in-package.test.js')

it('external', async () => {
it.skipIf(isVite7)('external', async () => {
const { stderr } = await runVitest({
root,
}, [testFile])
expect(removeNodeModules(removeLines(stderr))).toMatchSnapshot()
})

it('inline', async () => {
it.skipIf(isVite7)('inline', async () => {
const { stderr } = await runVitest({
root,
server: {
Expand Down
Loading