Nuxt/test/presets/vercel.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

18 lines
516 B
JavaScript

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