@nuxt/test-utils
Version:
Test utilities for Nuxt
15 lines (14 loc) • 476 B
JavaScript
import * as _kit from "@nuxt/kit";
import { createTest, exposeContextToEnv } from "@nuxt/test-utils/e2e";
const kit = _kit.default || _kit;
const options = JSON.parse(process.env.NUXT_TEST_OPTIONS || "{}");
const hooks = createTest(options);
export const setup = async () => {
kit.logger.info("Building Nuxt app...");
await hooks.setup();
exposeContextToEnv();
kit.logger.info("Running tests...");
};
export const teardown = async () => {
await hooks.afterAll();
};