mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
test: remove JS payload test + add non-async context test (#22530)
This commit is contained in:
parent
37ba586300
commit
53c706b575
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -169,7 +169,7 @@ jobs:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
env: ['dev', 'built']
|
||||
builder: ['vite', 'webpack']
|
||||
payload: ['json', 'js']
|
||||
context: ['async', 'default']
|
||||
node: [16]
|
||||
exclude:
|
||||
- env: 'dev'
|
||||
@ -231,8 +231,8 @@ jobs:
|
||||
env:
|
||||
TEST_ENV: ${{ matrix.env }}
|
||||
TEST_BUILDER: ${{ matrix.builder }}
|
||||
TEST_PAYLOAD: ${{ matrix.payload }}
|
||||
SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.payload == 'js' || runner.os == 'Windows' }}
|
||||
TEST_CONTEXT: ${{ matrix.context }}
|
||||
SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.context == 'default' || runner.os == 'Windows' }}
|
||||
|
||||
build-release:
|
||||
permissions:
|
||||
|
@ -20,7 +20,6 @@
|
||||
"play:preview": "nuxi preview playground",
|
||||
"test": "pnpm test:fixtures && pnpm test:fixtures:payload && pnpm test:fixtures:dev && pnpm test:fixtures:webpack && pnpm test:unit && pnpm typecheck",
|
||||
"test:fixtures": "nuxi prepare test/fixtures/basic && nuxi prepare test/fixtures/runtime-compiler && vitest run --dir test",
|
||||
"test:fixtures:payload": "TEST_PAYLOAD=js pnpm test:fixtures",
|
||||
"test:fixtures:dev": "TEST_ENV=dev pnpm test:fixtures",
|
||||
"test:fixtures:webpack": "TEST_BUILDER=webpack pnpm test:fixtures",
|
||||
"test:runtime": "vitest -c vitest.nuxt.config.ts",
|
||||
|
@ -1901,7 +1901,7 @@ describe.skipIf(isDev() || isWindows || !isRenderingJson)('payload rendering', (
|
||||
})
|
||||
})
|
||||
|
||||
describe('Async context', () => {
|
||||
describe.skipIf(process.env.TEST_CONTEXT !== 'async')('Async context', () => {
|
||||
it('should be available', async () => {
|
||||
expect(await $fetch('/async-context')).toContain('"hasApp": true')
|
||||
})
|
||||
|
3
test/fixtures/basic/nuxt.config.ts
vendored
3
test/fixtures/basic/nuxt.config.ts
vendored
@ -179,7 +179,6 @@ export default defineNuxtConfig({
|
||||
experimental: {
|
||||
typedPages: true,
|
||||
polyfillVueUseHead: true,
|
||||
renderJsonPayloads: process.env.TEST_PAYLOAD !== 'js',
|
||||
respectNoSSRHeader: true,
|
||||
clientFallback: true,
|
||||
restoreState: true,
|
||||
@ -188,7 +187,7 @@ export default defineNuxtConfig({
|
||||
reactivityTransform: true,
|
||||
treeshakeClientOnly: true,
|
||||
payloadExtraction: true,
|
||||
asyncContext: true,
|
||||
asyncContext: process.env.TEST_CONTEXT === 'async',
|
||||
headCapoPlugin: true
|
||||
},
|
||||
appConfig: {
|
||||
|
@ -6,7 +6,7 @@ import { reactive, ref, shallowReactive, shallowRef } from 'vue'
|
||||
import { createError } from 'h3'
|
||||
import { createPage, getBrowser, url, useTestContext } from '@nuxt/test-utils'
|
||||
|
||||
export const isRenderingJson = process.env.TEST_PAYLOAD !== 'js'
|
||||
export const isRenderingJson = true
|
||||
|
||||
export async function renderPage (path = '/') {
|
||||
const ctx = useTestContext()
|
||||
|
Loading…
Reference in New Issue
Block a user