Skip to content

Commit ae30471

Browse files
authored
test(nuxt): Add fake module and composable to E2E test (#16731)
This adds a `modules` and `composables` folder to the Nuxt 4 E2E test. The main purpose is to check, that the build runs through without problems. Additionally, the versions were updated (as this is the Nuxt 4 test and it should use the latest versions for the compatibility mode). Related to this: #15204 (comment)
1 parent 43403dc commit ae30471

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

dev-packages/e2e-tests/test-applications/nuxt-4/app/app.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
</NuxtLayout>
1414
</template>
1515

16-
<script setup>
16+
<script setup lang="ts">
17+
import { useSentryTestTag } from '#imports';
18+
19+
useSentryTestTag();
1720
</script>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// fixme: this needs to be imported from @sentry/core, not @sentry/nuxt in dev mode (because of import-in-the-middle error)
2+
// This could also be a problem with the specific setup of the pnpm E2E test setup, because this could not be reproduced outside of the E2E test.
3+
// Related to this: https://github.com/getsentry/sentry-javascript/issues/15204#issuecomment-2948908130
4+
import { setTag } from '@sentry/nuxt';
5+
6+
export default function useSentryTestTag(): void {
7+
setTag('test-tag', null);
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineNuxtModule } from 'nuxt/kit';
2+
3+
// Just a fake module to check if the SDK works alongside other local Nuxt modules without breaking the build
4+
export default defineNuxtModule({
5+
meta: { name: 'another-module' },
6+
setup() {
7+
console.log('another-module setup called');
8+
},
9+
});

dev-packages/e2e-tests/test-applications/nuxt-4/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
33
future: { compatibilityVersion: 4 },
4-
compatibilityDate: '2024-04-03',
4+
compatibilityDate: '2025-06-06',
55
imports: { autoImport: false },
66

77
modules: ['@pinia/nuxt', '@sentry/nuxt/module'],

dev-packages/e2e-tests/test-applications/nuxt-4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dependencies": {
1919
"@pinia/nuxt": "^0.5.5",
2020
"@sentry/nuxt": "latest || *",
21-
"nuxt": "^3.13.2"
21+
"nuxt": "^3.17.5"
2222
},
2323
"devDependencies": {
2424
"@playwright/test": "~1.50.0",

0 commit comments

Comments
 (0)