We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Case:
test('in component event handler via emit (async)', async () => { const err = new Error('foo') const fn = vi.fn() const Comp = { setup() { onErrorCaptured((err, instance, info) => { fn(err, info) return false }) return createComponent(Child, { async onFoo() { throw err }, }) }, } const Child = { props: ['onFoo'], setup(props: any, { emit }: any) { emit('foo') }, } define(Comp).render() await nextTick() expect(fn).toHaveBeenCalledWith(err, 'setup function') })
Error:
Vitest caught 2 unhandled errors during the test run. This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected. Error: foo ❯ packages/runtime-vapor/__tests__/errorHandling.spec.ts:383:17 381| 382| test('in component event handler via emit (async)', async () => { 383| const err = new Error('foo') | ^ 384| const fn = vi.fn() 385| ❯ node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:135:14 ❯ node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:60:26 ❯ runTest node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:771:17 ❯ runSuite node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:899:15 ❯ runSuite node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:899:15 ❯ runFiles node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:948:5 ❯ startTests node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:957:3 ❯ node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/runtime-runBaseTests.-x-nNuJ_.js:116:7 ❯ withEnv node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/runtime-runBaseTests.-x-nNuJ_.js:83:5 This error originated in "packages/runtime-vapor/__tests__/errorHandling.spec.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. Error: foo ❯ packages/runtime-vapor/__tests__/errorHandling.spec.ts:383:17 381| 382| test('in component event handler via emit (async)', async () => { 383| const err = new Error('foo') | ^ 384| const fn = vi.fn() 385| ❯ node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:135:14 ❯ node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:60:26 ❯ runTest node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:771:17 ❯ runSuite node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:899:15 ❯ runSuite node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:899:15 ❯ runFiles node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:948:5 ❯ startTests node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:957:3 ❯ node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/runtime-runBaseTests.-x-nNuJ_.js:116:7 ❯ withEnv node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/vitest/dist/chunks/runtime-runBaseTests.-x-nNuJ_.js:83:5 This error originated in "packages/runtime-vapor/__tests__/errorHandling.spec.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. Test Files 1 failed (1) Tests 1 failed | 12 passed (13) Errors 2 errors Start at 13:34:46 Duration 75ms
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Test Case:
Error:
The text was updated successfully, but these errors were encountered: