Skip to content

Commit

Permalink
fix: set mode as 'test', if it wasn't set (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Feb 9, 2022
1 parent cdd18bf commit bf079d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vitest/src/node/plugins/index.ts
Expand Up @@ -26,6 +26,9 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest())
preOptions.api = resolveApiConfig(preOptions)

return {
// we are setting NODE_ENV when running CLI to 'test',
// but it can be overriden
mode: viteConfig.mode || process.env.NODE_ENV || 'test',
clearScreen: false,
resolve: {
// by default Vite resolves `module` field, which not always a native ESM module
Expand Down

0 comments on commit bf079d2

Please sign in to comment.