Skip to content

Commit

Permalink
test: Remove explict casting of baseconfig in vite configs (#12979)
Browse files Browse the repository at this point in the history
Something I noticed while doing my jest -> vitest conversions, we don't
need this anymore.
  • Loading branch information
AbhiPrasad authored Jul 18, 2024
1 parent 789231c commit cf6eb01
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 28 deletions.
6 changes: 1 addition & 5 deletions packages/astro/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import type { UserConfig } from 'vitest';

import baseConfig from '../../vite/vite.config';

export default {
...baseConfig,
test: {
// test exists, no idea why TS doesn't recognize it
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(baseConfig as UserConfig & { test: any }).test,
...baseConfig.test,
environment: 'jsdom',
},
};
5 changes: 1 addition & 4 deletions packages/nestjs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import type { UserConfig } from 'vitest';
import { defineConfig } from 'vitest/config';
import baseConfig from '../../vite/vite.config';

export default defineConfig({
...baseConfig,
test: {
// test exists, no idea why TS doesn't recognize it
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(baseConfig as UserConfig & { test: any }).test,
...baseConfig.test,
environment: 'node',
},
});
3 changes: 1 addition & 2 deletions packages/replay-internal/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { UserConfig } from 'vitest';
import { defineConfig } from 'vitest/config';

import baseConfig from '../../vite/vite.config';

export default defineConfig({
...baseConfig,
test: {
...(baseConfig as UserConfig & { test: any }).test,
...baseConfig.test,
coverage: {},
globals: true,
setupFiles: ['./test.setup.ts'],
Expand Down
5 changes: 1 addition & 4 deletions packages/solid/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import solidPlugin from 'vite-plugin-solid';
import type { UserConfig } from 'vitest';
import baseConfig from '../../vite/vite.config';

export default {
...baseConfig,
plugins: [solidPlugin({ hot: !process.env.VITEST })],
test: {
// test exists, no idea why TS doesn't recognize it
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(baseConfig as UserConfig & { test: any }).test,
...baseConfig.test,
environment: 'jsdom',
},
};
5 changes: 1 addition & 4 deletions packages/solidstart/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import solidPlugin from 'vite-plugin-solid';
import type { UserConfig } from 'vitest';
import baseConfig from '../../vite/vite.config';

export default {
...baseConfig,
plugins: [solidPlugin({ hot: !process.env.VITEST })],
test: {
// test exists, no idea why TS doesn't recognize it
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(baseConfig as UserConfig & { test: any }).test,
...baseConfig.test,
environment: 'jsdom',
},
};
5 changes: 1 addition & 4 deletions packages/svelte/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { svelte } from '@sveltejs/vite-plugin-svelte';
import type { UserConfig } from 'vitest';
import baseConfig from '../../vite/vite.config';

export default {
...baseConfig,
plugins: [svelte({ hot: !process.env.VITEST })],
test: {
// test exists, no idea why TS doesn't recognize it
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(baseConfig as UserConfig & { test: any }).test,
...baseConfig.test,
environment: 'jsdom',
alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }],
},
Expand Down
6 changes: 1 addition & 5 deletions packages/sveltekit/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';

import type { UserConfig } from 'vitest';

import baseConfig from '../../vite/vite.config';

export default {
...baseConfig,
test: {
// test exists, no idea why TS doesn't recognize it
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(baseConfig as UserConfig & { test: any }).test,
...baseConfig.test,
setupFiles: ['./test/vitest.setup.ts'],
alias: [
{
Expand Down

0 comments on commit cf6eb01

Please sign in to comment.