mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge pull request #294 from appwrite/test-improve-config
test: improve vite config
This commit is contained in:
2 files changed
+14
-6
No files matched your search
@@ -1,15 +1,10 @@
|
||||
import { vi } from 'vitest';
|
||||
import * as svelteinternal from 'svelte/internal';
|
||||
|
||||
beforeAll(() => {
|
||||
vi.mock('$app/environment', () => ({
|
||||
browser: true
|
||||
}));
|
||||
vi.mock('$app/stores', () => ({
|
||||
page: null
|
||||
}));
|
||||
vi.mock('$app/navigation', () => ({
|
||||
goto: vi.fn()
|
||||
}));
|
||||
vi.mock('svelte', () => svelteinternal);
|
||||
});
|
||||
+14
-1
@@ -17,6 +17,14 @@ const config = {
|
||||
},
|
||||
server: {
|
||||
port: 3000
|
||||
}
|
||||
};
|
||||
|
||||
/** @type {import('vite').UserConfig} */
|
||||
const testConfig = {
|
||||
resolve: {
|
||||
// hotfix for https://github.com/vitest-dev/vitest/issues/2834
|
||||
conditions: ['browser']
|
||||
},
|
||||
test: {
|
||||
include: ['tests/**/*.test.ts'],
|
||||
@@ -30,4 +38,9 @@ const config = {
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
export default process.env.VITEST
|
||||
? {
|
||||
...config,
|
||||
...testConfig
|
||||
}
|
||||
: config;
|
||||
Reference in new issue
Block a user