Added vitest (#5)

* Moved eslint and @nuxt/eslint to devDependencies

* Added vitest to project and 1 test

* Tweaked Sonar workflow in order to run tests and coverage

* Removed offending config line
This commit is contained in:
Liviu Burcusel 2025-10-24 17:20:05 +02:00 committed by GitHub
parent c98879430b
commit 3b58a25ccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 942 additions and 15 deletions

18
tests/app.test.ts Normal file
View file

@ -0,0 +1,18 @@
import { describe, expect, it } from "vitest";
import type { VueWrapper } from "@vue/test-utils";
import { mount } from "@vue/test-utils";
import App from "../app/app.vue";
describe("app.vue", () => {
const wrapper: VueWrapper = mount(App, {
global: {
stubs: {
NuxtRouteAnnouncer: true,
NuxtWelcome: true,
},
},
});
it("renders without crashing", () => {
expect(wrapper.exists()).toBe(true);
});
});

10
tests/setup.ts Normal file
View file

@ -0,0 +1,10 @@
import { vi } from "vitest";
Object.defineProperty(global, "import", {
value: {
meta: {
glob: vi.fn(() => ({})),
},
},
writable: true,
});