mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 22:29:11 +03:00
* update gh action, update vitest config * debug * debug cov * idk try something different * test2 * test3 * add base path * rm debug * add apiAuthenticate tests * supabaseClient tests * apiWrappers tests * add apiHelpers tests * add configcat tests * add formatSql tests * add github tests * add cloudprovider utils tests * add helpers tests * fix typeerr * add missing readonly err * fix typeerrrs * fix type errors in apiWrapper tests * fix apiHelpers test * add packages/ui tests * add coveralls flags * try coveralls parallel config * fix coveralls parallel config --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import react from '@vitejs/plugin-react'
|
|
import path, { resolve } from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
// Some tools like Vitest VSCode extensions, have trouble with resolving relative paths,
|
|
// as they use the directory of the test file as `cwd`, which makes them believe that
|
|
// `setupFiles` live next to the test file itself. This forces them to always resolve correctly.
|
|
const dirname = fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tsconfigPaths({
|
|
projects: ['.'],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@ui': path.resolve(__dirname, './../../packages/ui/src'),
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom', // TODO(kamil): This should be set per test via header in .tsx files only
|
|
include: [resolve(dirname, './**/*.test.{ts,tsx}')],
|
|
restoreMocks: true,
|
|
setupFiles: [
|
|
resolve(dirname, './tests/vitestSetup.ts'),
|
|
resolve(dirname, './tests/setup/polyfills.js'),
|
|
resolve(dirname, './tests/setup/radix.js'),
|
|
],
|
|
reporters: [['default']],
|
|
coverage: {
|
|
reporter: ['lcov'],
|
|
exclude: ['**/*.test.ts', '**/*.test.tsx'],
|
|
include: ['lib/**/*.ts'],
|
|
},
|
|
},
|
|
})
|