Nuxt/test/presets/node.test.mjs
2021-09-27 14:49:36 +02:00

17 lines
469 B
JavaScript

import { resolve } from 'pathe'
import { startServer, setupTest, testNitroBehavior, importModule } from './_tests.mjs'
describe('nitro:preset:node', () => {
const ctx = setupTest('node')
testNitroBehavior(ctx, async () => {
const { handle } = await importModule(resolve(ctx.outDir, 'server/index.mjs'))
await startServer(ctx, handle)
return async ({ url }) => {
const data = await ctx.fetch(url)
return {
data
}
}
})
})