From f9c64e70168072dca0933a25c6edef90ee954e94 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Wed, 24 Jul 2024 10:21:36 +0200 Subject: [PATCH] docs: Update e2e test config docs --- docs/docs/guides/developer-guide/testing/index.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/docs/guides/developer-guide/testing/index.md b/docs/docs/guides/developer-guide/testing/index.md index a07aef1b1e..c0f0c93301 100644 --- a/docs/docs/guides/developer-guide/testing/index.md +++ b/docs/docs/guides/developer-guide/testing/index.md @@ -26,18 +26,22 @@ For a working example of a Vendure plugin with e2e testing, see the [real-world- - `@swc/core` - `unplugin-swc` +```sh +npm install --save-dev @vendure/testing vitest graphql-tag @swc/core unplugin-swc +``` + ### Configure Vitest -Create a `vitest.config.js` file in the root of your project: +Create a `vitest.config.mts` file in the root of your project: -```ts +```ts title="vitest.config.mts" import path from 'path'; import swc from 'unplugin-swc'; import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { - include: '**/*.e2e-spec.ts', + include: ['**/*.e2e-spec.ts'], typecheck: { tsconfig: path.join(__dirname, 'tsconfig.e2e.json'), }, @@ -60,9 +64,9 @@ export default defineConfig({ and a `tsconfig.e2e.json` tsconfig file for the tests: -```json +```json title="tsconfig.e2e.json" { - "extends": "../tsconfig.json", + "extends": "./tsconfig.json", "compilerOptions": { "types": ["node"], "lib": ["es2015"],