Skip to content

Commit 8bc5e1d

Browse files
committed
Use client rendered tests vs SSR
Hitting the issue found in nuxt/nuxt#34645. Instead of trying to find a workaround when they are actively working on a fix seems silly. Nuxt-common only uses client rendered tests anyways and that is how we use them so lets just do that instead.
1 parent 533b18d commit 8bc5e1d

3 files changed

Lines changed: 12 additions & 17 deletions

File tree

template/test/basic.nuxt.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { mountSuspended } from "@nuxt/test-utils/runtime";
2+
import { describe, expect, it } from "vitest";
3+
import App from "./fixtures/basic/app.vue";
4+
5+
describe("verify basic fixture test (useful as an example, update for your app)", () => {
6+
it("renders the index page", async () => {
7+
expect.assertions(1);
8+
9+
const wrapper = await mountSuspended(App);
10+
expect(wrapper.html()).toContain("<div>basic</div>");
11+
});
12+
});

template/test/basic.spec.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

template/vitest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default defineVitestConfig({
1313
},
1414
},
1515
test: {
16-
environment: "nuxt",
1716
environmentOptions: {
1817
nuxt: {
1918
rootDir: fileURLToPath(new URL("./test/fixtures/basic", import.meta.url)),

0 commit comments

Comments
 (0)