Files
supabase/apps/studio/vitest.config.mts
T
Joshen Lim 9e45053d25 Chore/sql editor pagination of results (#26857)
* Add pagination to SQL editor for results longer than 100 rows

* Change pagination to automatically setting a limit

* Fix

* Address initial comments

* Compress SQL editor actions when ai assistant is open and screen is of a certain width

* Fix checking

* Add some fixes and tests

* Add a message if the query had an error and the limit was applied

* Rename to suffixWithLimit

* Small refactor and fix
2024-06-04 15:20:18 +07:00

41 lines
1.3 KiB
TypeScript

import { defineConfig } from 'vitest/config'
import tsconfigPaths from 'vite-tsconfig-paths'
import { fileURLToPath } from 'url'
import { resolve } from 'path'
import path from 'path'
import react from '@vitejs/plugin-react'
// 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, './tests/**/*.test.{ts,tsx}'),
resolve(dirname, './components/**/*.test.{ts,tsx}'),
],
restoreMocks: true,
setupFiles: [
resolve(dirname, './tests/vitestSetup.ts'),
resolve(dirname, './tests/setup/testing-library-matchers.js'),
resolve(dirname, './tests/setup/polyfills.js'),
resolve(dirname, './tests/setup/radix.js'),
],
},
})