test: remove JS payload test + add non-async context test (#22530)

This commit is contained in:
Daniel Roe 2023-08-08 10:45:37 +01:00 committed by GitHub
parent 37ba586300
commit 53c706b575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 8 deletions

View File

@ -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:

View File

@ -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",

View File

@ -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')
})

View File

@ -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: {

View File

@ -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()