2024-07-17 12:54:21 +03:00
|
|
|
/**
|
|
|
|
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2024-07-20 00:18:24 +03:00
|
|
|
import { defineConfig } from "vitest/config";
|
2024-04-21 15:35:14 +03:00
|
|
|
import viteConfig from "./vite.config";
|
|
|
|
|
|
|
|
export default async (env: Parameters<typeof viteConfig>[0]) => {
|
|
|
|
const config =
|
|
|
|
typeof viteConfig === "function" ? await viteConfig(env) : viteConfig;
|
|
|
|
|
2024-07-20 00:18:24 +03:00
|
|
|
return defineConfig({
|
|
|
|
...config,
|
|
|
|
// node-externals conflicts with vitest
|
|
|
|
plugins: config.plugins!.filter(
|
|
|
|
(plugin) =>
|
|
|
|
plugin && (!("name" in plugin) || plugin?.name !== "node-externals")
|
|
|
|
),
|
|
|
|
test: {
|
|
|
|
coverage: {
|
|
|
|
reporter: ["text", "lcov"],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|