Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nuxt,schema): use std-env to detect whether app is being tested #23830

Merged
merged 2 commits into from Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/nitro.ts
Expand Up @@ -215,7 +215,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
if (nuxt.options.experimental.appManifest) {
// @ts-expect-error untyped nuxt property
const buildId = nuxt.options.appConfig.nuxt!.buildId ||=
(nuxt.options.test ? 'test' : nuxt.options.dev ? 'dev' : randomUUID())
(nuxt.options.dev ? 'dev' : nuxt.options.test ? 'test' : randomUUID())
const buildTimestamp = Date.now()

const manifestPrefix = joinURL(nuxt.options.app.buildAssetsDir, 'builds')
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/src/config/common.ts
@@ -1,6 +1,6 @@
import { defineUntypedSchema } from 'untyped'
import { join, relative, resolve } from 'pathe'
import { isDebug, isDevelopment } from 'std-env'
import { isDebug, isDevelopment, isTest } from 'std-env'
import { defu } from 'defu'
import { findWorkspaceDir } from 'pkg-types'
import type { RuntimeConfig } from '../types/config'
Expand Down Expand Up @@ -158,7 +158,7 @@ export default defineUntypedSchema({
/**
* Whether your app is being unit tested.
*/
test: Boolean(isDevelopment),
test: Boolean(isTest),

/**
* Set to `true` to enable debug mode.
Expand Down