Skip to content

Commit

Permalink
fix(e2e): set NODE_ENV when running built server (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Oct 8, 2024
1 parent 8ddcf3c commit eaa7e0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function createTestContext(options: Partial<TestOptions>): TestContext {
logLevel: 1,
server: true,
build: (options.browser !== false) || (options.server !== false),
env: {},
nuxtConfig: {
// suppress compatibility date warning for runtime environment tests
compatibilityDate: '2024-04-03' as DateString,
Expand All @@ -25,6 +26,10 @@ export function createTestContext(options: Partial<TestOptions>): TestContext {
},
} satisfies Partial<TestOptions>)

if (!_options.dev) {
_options.env!.NODE_ENV ||= 'production'
}

// Disable build and server if endpoint is provided
if (_options.host) {
_options.build = false
Expand Down

0 comments on commit eaa7e0a

Please sign in to comment.