Nuxt/test/presets/node.test.mjs
pooya parsa 6318438415
feat(nitro, vite): use native module (#252)
Co-authored-by: Daniel Roe <daniel@roe.dev>
2021-07-15 11:38:06 +02:00

17 lines
468 B
JavaScript

import { resolve } from 'path'
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
}
}
})
})