mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-19 16:01:24 +00:00
test: ensure dev tests have separate buildDirs
This commit is contained in:
parent
82ca08f933
commit
d7623f884c
@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { isWindows } from 'std-env'
|
||||
import { $fetch, createPage, setup, url } from '@nuxt/test-utils/e2e'
|
||||
import { join } from 'pathe'
|
||||
|
||||
const isWebpack =
|
||||
process.env.TEST_BUILDER === 'webpack' ||
|
||||
@ -9,14 +10,17 @@ const isWebpack =
|
||||
|
||||
const isDev = process.env.TEST_ENV === 'dev'
|
||||
|
||||
const fixtureDir = fileURLToPath(new URL('../fixtures/spa-loader', import.meta.url))
|
||||
|
||||
if (!isDev) {
|
||||
await setup({
|
||||
rootDir: fileURLToPath(new URL('../fixtures/spa-loader', import.meta.url)),
|
||||
rootDir: fixtureDir,
|
||||
dev: isDev,
|
||||
server: true,
|
||||
browser: true,
|
||||
setupTimeout: (isWindows ? 360 : 120) * 1000,
|
||||
nuxtConfig: {
|
||||
buildDir: isDev ? join(fixtureDir, '.nuxt', 'test', Math.random().toString(36).slice(2, 8)) : undefined,
|
||||
builder: isWebpack ? 'webpack' : 'vite',
|
||||
spaLoadingTemplate: true,
|
||||
experimental: {
|
||||
|
@ -3,17 +3,21 @@ import { describe, expect, it } from 'vitest'
|
||||
import { isWindows } from 'std-env'
|
||||
import { createPage, setup, url } from '@nuxt/test-utils/e2e'
|
||||
import type { Page } from 'playwright-core'
|
||||
import { join } from 'pathe'
|
||||
|
||||
const isWebpack = process.env.TEST_BUILDER === 'webpack' || process.env.TEST_BUILDER === 'rspack'
|
||||
const isDev = process.env.TEST_ENV === 'dev'
|
||||
|
||||
const fixtureDir = fileURLToPath(new URL('../fixtures/spa-loader', import.meta.url))
|
||||
|
||||
if (!isDev) {
|
||||
await setup({
|
||||
rootDir: fileURLToPath(new URL('../fixtures/spa-loader', import.meta.url)),
|
||||
rootDir: fixtureDir,
|
||||
server: true,
|
||||
browser: true,
|
||||
setupTimeout: (isWindows ? 360 : 120) * 1000,
|
||||
nuxtConfig: {
|
||||
buildDir: isDev ? join(fixtureDir, '.nuxt', 'test', Math.random().toString(36).slice(2, 8)) : undefined,
|
||||
builder: isWebpack ? 'webpack' : 'vite',
|
||||
spaLoadingTemplate: true,
|
||||
experimental: {
|
||||
|
Loading…
Reference in New Issue
Block a user