aboutsummaryrefslogtreecommitdiffstats
path: root/vitest.config.ts
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-08-24 16:51:18 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-08-26 17:27:22 +0200
commitc0b39bb9095b9e0421314c99d3ff0e149a21c435 (patch)
tree8d8ebdf0a9052e84dfd0df6b2e5d6f2580633c02 /vitest.config.ts
parentc6ec82203e3615f1493bbb230eea8e2fba9abfa8 (diff)
downloadnextcloud-server-c0b39bb9095b9e0421314c99d3ff0e149a21c435.tar.gz
nextcloud-server-c0b39bb9095b9e0421314c99d3ff0e149a21c435.zip
chore: Move from Jest to vitest
There are some benefits, like faster tests and thus saving CI time, but the main reason for me is: Jest still does not properly support ESM packages, this casues a lot of breaking stuff. Sometimes you need to adjust imports for mocking, and somethimes other random stuff break. Instead of wasting valuable developer lifetime we can use vitest which works perfectly with ESM. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'vitest.config.ts')
-rw-r--r--vitest.config.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/vitest.config.ts b/vitest.config.ts
new file mode 100644
index 00000000000..e58902789b3
--- /dev/null
+++ b/vitest.config.ts
@@ -0,0 +1,26 @@
+/**
+ * SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: CC0-1.0
+ */
+import { defineConfig } from 'vitest/config'
+import vue from '@vitejs/plugin-vue2'
+
+export default defineConfig({
+ plugins: [vue()],
+ test: {
+ include: ['{apps,core}/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
+ environment: 'jsdom',
+ coverage: {
+ include: ['apps/*/src/**', 'core/src/**'],
+ exclude: ['**.spec.*', '**.test.*', '**.cy.*', 'core/src/tests/**'],
+ provider: 'v8',
+ reporter: ['lcov', 'text'],
+ },
+ setupFiles: ['__tests__/mock-window.js', '__tests__/setup-testing-library.js'],
+ server: {
+ deps: {
+ inline: [/@nextcloud\//],
+ },
+ },
+ },
+})