mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt,schema): use std-env
to detect whether app is being tested (#23830)
This commit is contained in:
parent
ffa6b6e60c
commit
591f4305b8
@ -215,7 +215,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
if (nuxt.options.experimental.appManifest) {
|
if (nuxt.options.experimental.appManifest) {
|
||||||
// @ts-expect-error untyped nuxt property
|
// @ts-expect-error untyped nuxt property
|
||||||
const buildId = nuxt.options.appConfig.nuxt!.buildId ||=
|
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 buildTimestamp = Date.now()
|
||||||
|
|
||||||
const manifestPrefix = joinURL(nuxt.options.app.buildAssetsDir, 'builds')
|
const manifestPrefix = joinURL(nuxt.options.app.buildAssetsDir, 'builds')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { defineUntypedSchema } from 'untyped'
|
import { defineUntypedSchema } from 'untyped'
|
||||||
import { join, relative, resolve } from 'pathe'
|
import { join, relative, resolve } from 'pathe'
|
||||||
import { isDebug, isDevelopment } from 'std-env'
|
import { isDebug, isDevelopment, isTest } from 'std-env'
|
||||||
import { defu } from 'defu'
|
import { defu } from 'defu'
|
||||||
import { findWorkspaceDir } from 'pkg-types'
|
import { findWorkspaceDir } from 'pkg-types'
|
||||||
import type { RuntimeConfig } from '../types/config'
|
import type { RuntimeConfig } from '../types/config'
|
||||||
@ -158,7 +158,7 @@ export default defineUntypedSchema({
|
|||||||
/**
|
/**
|
||||||
* Whether your app is being unit tested.
|
* Whether your app is being unit tested.
|
||||||
*/
|
*/
|
||||||
test: Boolean(isDevelopment),
|
test: Boolean(isTest),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to enable debug mode.
|
* Set to `true` to enable debug mode.
|
||||||
|
Loading…
Reference in New Issue
Block a user