Files
template-showcase/vitest.config.ts
T

20 lines
719 B
TypeScript

import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
export default defineConfig({
resolve: {
alias: [
{ find: /^@\//, replacement: `${fileURLToPath(new URL('./src', import.meta.url))}/` },
{ find: /^server-only$/, replacement: fileURLToPath(new URL('./test/server-only.ts', import.meta.url)) },
],
},
// The tests transform JSX themselves (oxc automatic runtime).
oxc: { jsx: { runtime: 'automatic' } },
test: {
include: ['src/**/*.test.{ts,tsx}', 'test/*.test.ts'],
environment: 'node',
// The SDK's dist imports sibling modules without extensions, which plain Node ESM rejects.
server: { deps: { inline: [/@conusai-sdk\//] } },
},
})