-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8061cac
commit 15960a5
Showing
7 changed files
with
94 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 15 additions & 14 deletions
29
apps/app/test-with-vite/download-mongo-binary/vitest.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { defineConfig, mergeConfig } from 'vitest/config'; | ||
import tsconfigPaths from 'vite-tsconfig-paths'; | ||
import { defineConfig } from 'vitest/config'; | ||
|
||
import configShared from '../../vitest.config'; | ||
|
||
export default mergeConfig( | ||
configShared, | ||
defineConfig({ | ||
test: { | ||
hookTimeout: 60000, // increased for downloading MongoDB binary file | ||
setupFiles: [ | ||
'./test-with-vite/setup/mongoms.ts', | ||
], | ||
}, | ||
}), | ||
); | ||
export default defineConfig({ | ||
plugins: [ | ||
tsconfigPaths(), | ||
], | ||
test: { | ||
clearMocks: true, | ||
globals: true, | ||
hookTimeout: 60000, // increased for downloading MongoDB binary file | ||
setupFiles: [ | ||
'./test-with-vite/setup/mongoms.ts', | ||
], | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import react from '@vitejs/plugin-react'; | ||
import tsconfigPaths from 'vite-tsconfig-paths'; | ||
import { defineProject, defineWorkspace, mergeConfig } from 'vitest/config'; | ||
|
||
const projectShared = defineProject({ | ||
plugins: [ | ||
tsconfigPaths(), | ||
], | ||
test: { | ||
clearMocks: true, | ||
globals: true, | ||
}, | ||
}); | ||
|
||
export default defineWorkspace([ | ||
|
||
// unit test | ||
mergeConfig( | ||
projectShared, | ||
{ | ||
test: { | ||
name: 'app-unit', | ||
environment: 'node', | ||
include: ['**/*.spec.{ts,js}'], | ||
exclude: ['**/test/**'], | ||
coverage: { | ||
reportsDirectory: './coverage/unit', | ||
}, | ||
}, | ||
}, | ||
), | ||
|
||
// integration test | ||
mergeConfig( | ||
projectShared, | ||
{ | ||
test: { | ||
name: 'app-integration', | ||
environment: 'node', | ||
include: ['**/*.integ.ts'], | ||
exclude: ['**/test/**'], | ||
setupFiles: [ | ||
'./test-with-vite/setup/mongoms.ts', | ||
], | ||
coverage: { | ||
reportsDirectory: './coverage/integ', | ||
exclude: [ | ||
'**/*{.,-}integ.ts', | ||
], | ||
}, | ||
}, | ||
}, | ||
), | ||
|
||
// component test | ||
mergeConfig( | ||
projectShared, | ||
{ | ||
plugins: [react()], | ||
test: { | ||
name: 'app-components', | ||
environment: 'happy-dom', | ||
include: [ | ||
'**/*.spec.{tsx,jsx}', | ||
], | ||
exclude: ['**/test/**'], | ||
coverage: { | ||
reportsDirectory: './coverage/components', | ||
}, | ||
}, | ||
}, | ||
), | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export default [ | ||
'apps/*/vitest.config.ts', | ||
'apps/*/vitest.workspace.ts', | ||
'packages/*/vitest.config.ts', | ||
'packages/*/vitest.workspace.ts', | ||
]; |