-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(nuxt): Add E2E test with NuxtErrorBoundary (#14754)
Adding a test to make sure error events bubble up when using `NuxtErrorBoundary`
- Loading branch information
Showing
4 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
11 changes: 8 additions & 3 deletions
11
dev-packages/e2e-tests/test-applications/nuxt-3/pages/client-error.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
<script setup> | ||
import ErrorButton from '../components/ErrorButton.vue'; | ||
const catchErr = () => { | ||
console.log('Additional functionality in NuxtErrorBoundary'); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ErrorButton id="errorBtn" error-text="Error thrown from Nuxt-3 E2E test app"/> | ||
<ErrorButton id="errorBtn2" error-text="Another Error thrown from Nuxt-3 E2E test app"/> | ||
</template> | ||
|
||
|
||
|
||
<NuxtErrorBoundary @error="catchErr"> | ||
<ErrorButton id="error-in-error-boundary" error-text="Error thrown in Error Boundary"/> | ||
</NuxtErrorBoundary> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
dev-packages/e2e-tests/test-applications/nuxt-4/app/pages/client-error.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
<script setup> | ||
import ErrorButton from '../components/ErrorButton.vue'; | ||
const catchErr = () => { | ||
console.log('Additional functionality in NuxtErrorBoundary'); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ErrorButton id="errorBtn" error-text="Error thrown from Nuxt-4 E2E test app"/> | ||
<ErrorButton id="errorBtn2" error-text="Another Error thrown from Nuxt-4 E2E test app"/> | ||
</template> | ||
|
||
|
||
|
||
<NuxtErrorBoundary @error="catchErr"> | ||
<ErrorButton id="error-in-error-boundary" error-text="Error thrown in Error Boundary"/> | ||
</NuxtErrorBoundary> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters