From 8d99a63648d2ef58a5c21ca4b27316b4dced37e9 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 17 Apr 2022 12:21:50 -0400 Subject: [PATCH] add vitest and testing-library --- package.json | 6 +++++- vitest.config.js | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 vitest.config.js diff --git a/package.json b/package.json index 710e89f..bfa5b6b 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "@sveltejs/adapter-static": "^1.0.0-next.28", "@sveltejs/kit": "^1.0.0-next.288", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.38", + "@testing-library/svelte": "^3.1.1", + "@testing-library/user-event": "^13.5.0", "eslint": "^8.10.0", "eslint-config-prettier": "^8.4.0", "eslint-plugin-svelte3": "^3.4.1", @@ -25,7 +27,9 @@ "prettier-plugin-svelte": "^2.6.0", "standard-version": "^9.3.2", "storybook-builder-vite": "0.1.21", - "svelte": "^3.46.4" + "svelte": "^3.46.4", + "vitest": "^0.9.3", + "vitest-svelte-kit": "^0.0.6" }, "dependencies": { "@storybook/addon-essentials": "^6.4.19", diff --git a/vitest.config.js b/vitest.config.js new file mode 100644 index 0000000..78214f1 --- /dev/null +++ b/vitest.config.js @@ -0,0 +1,9 @@ +import { extractFromSvelteConfig } from "vitest-svelte-kit"; + +export default extractFromSvelteConfig().then((config) => ({ + ...config, + test: { + globals: true, + environment: "jsdom", + }, + }));