Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneTASTEWINMGestione fileStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailInvestimentiTASTESTOCKApp desktop di trading automatico azionarioIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuroTASTEWINMUn file manager a due pannelli pensato per la tastiera

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Investimenti

TASTESTOCKTrading automatico azionario secondo le regole che decidi tu: quando e che cosa

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeChi siamoInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
Ieri
Visualizzazioni totali
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di Vue.js · Nuxt
Vue.js · Nuxt
Getting Started with Vue and NuxtProject StructureCore Concepts: SFCs, Reactivity, Components, Nuxt RoutingData and StateTestingBuild and Deployment
Discussioni

Guida a Vue.js · Nuxt · 5/6

Testing

Per ora questo capitolo è disponibile solo in inglese.

Tests in a Vue project usually come in three layers. Pure logic such as composables and stores is checked with Vitest, components with Vitest plus Vue Test Utils, and real user flows with an end-to-end tool such as Playwright. In Nuxt projects, @nuxt/test-utils boots a Nuxt environment inside your tests.

Setting up Vitest

If you selected Vitest in create-vue, everything is already configured. To add it by hand, install these packages:

npm install -D vitest @vue/test-utils jsdom

vitest.config.ts extends the Vite config and selects the jsdom environment, which emulates browser APIs:

import { fileURLToPath } from "node:url";
import { mergeConfig, defineConfig, configDefaults } from "vitest/config";
import viteConfig from "./vite.config";

export default mergeConfig(
  viteConfig,
  defineConfig({
    test: {
      environment: "jsdom",
      exclude: [...configDefaults.exclude, "e2e/**"],
      root: fileURLToPath(new URL("./", import.meta.url)),
    },
  }),
);

npm run test:unit (or npx vitest) runs tests in watch mode, re-running only the affected tests each time you save.

Testing logic and stores

Call a composable like any function and assert on the result. For Pinia stores, activate a fresh Pinia before each test so tests do not leak state into each other.

import { describe, it, expect, beforeEach } from "vitest";
import { setActivePinia, createPinia } from "pinia";
import { useCounter } from "@/composables/useCounter";
import { useCartStore } from "@/stores/cart";

describe("useCounter", () => {
  it("increments and doubles", () => {
    const { count, double, increment } = useCounter(1);
    increment();
    expect(count.value).toBe(2);
    expect(double.value).toBe(4);
  });
});

describe("cart store", () => {
  beforeEach(() => setActivePinia(createPinia()));

  it("increases quantity for the same item", () => {
    const cart = useCartStore();
    cart.add({ id: 1, name: "Book", price: 100 });
    cart.add({ id: 1, name: "Book", price: 100 });
    expect(cart.items[0].qty).toBe(2);
    expect(cart.total).toBe(200);
  });
});

Testing components

mount from Vue Test Utils renders a component and returns a wrapper. Pass props, find elements, trigger events, then assert on the rendered text or emitted events. DOM updates are asynchronous, so await calls to trigger and setValue.

import { describe, it, expect } from "vitest";
import { mount } from "@vue/test-utils";
import TodoItem from "@/components/TodoItem.vue";

describe("TodoItem", () => {
  it("renders the text and emits remove", async () => {
    const wrapper = mount(TodoItem, { props: { text: "Groceries", done: false } });

    expect(wrapper.text()).toContain("Groceries");

    await wrapper.find("button").trigger("click");
    expect(wrapper.emitted("remove")?.[0]).toEqual(["user"]);
  });
});
Domande su questo capitolo?
Capitolo precedenteData and StateCapitolo successivoBuild and Deployment

Components that rely on global plugins can receive them with mount(Comp, { global: { plugins: [router, createPinia()] } }). Tests that assert on what the user sees, rather than on implementation details, survive refactoring much better.

Nuxt test utilities

Nuxt components depend on auto-imports and Nuxt composables, so they will not run in a plain jsdom environment. @nuxt/test-utils provides a nuxt environment that boots the Nuxt runtime inside tests, plus mountSuspended.

npm install -D @nuxt/test-utils vitest @vue/test-utils happy-dom
// vitest.config.ts
import { defineVitestConfig } from "@nuxt/test-utils/config";

export default defineVitestConfig({
  test: { environment: "nuxt" },
});
// tests/counter.nuxt.test.ts
import { it, expect } from "vitest";
import { mountSuspended } from "@nuxt/test-utils/runtime";
import AppCounter from "~/components/AppCounter.vue";

it("renders inside the Nuxt environment", async () => {
  const wrapper = await mountSuspended(AppCounter);
  expect(wrapper.text()).toContain("0");
});

mountSuspended waits for async setup and useFetch to resolve before returning. You can mock server API calls with registerEndpoint.

End-to-end tests with Playwright

End-to-end tests open the app in a real browser and drive it like a user would. Select Playwright in create-vue, or add it with npm init playwright@latest.

// e2e/home.spec.ts
import { test, expect } from "@playwright/test";

test("filters the list by search query", async ({ page }) => {
  await page.goto("/");
  await page.getByPlaceholder("Search").fill("Vue");
  await expect(page.getByRole("listitem")).toHaveCount(1);
});

Set the webServer option in playwright.config.ts to the command that starts your dev or preview server, and Playwright launches it before the tests. Run npx playwright test, and add --ui to step through tests interactively.

Summary

  • Check logic, stores and components quickly with Vitest and Vue Test Utils.
  • In Pinia store tests, call setActivePinia(createPinia()) before each test.
  • Test Nuxt components with the nuxt environment and mountSuspended from @nuxt/test-utils.
  • Verify critical user flows in a real browser with Playwright end-to-end tests.

0 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.