20 lines
465 B
TypeScript
20 lines
465 B
TypeScript
import { test, type TestContext } from 'node:test'
|
|
|
|
import processPlugin from '../routes/api/process.ts'
|
|
import fastify from 'fastify'
|
|
|
|
test('/api/process', async (t: TestContext) => {
|
|
const server = fastify()
|
|
|
|
server.decorate('auth', (_request, _reply, done) => done())
|
|
|
|
server.register(processPlugin, { prefix: '/api/process' })
|
|
|
|
const res = await server.inject({
|
|
method: 'GET',
|
|
url: '/api/process',
|
|
})
|
|
|
|
t.assert.equal(res.statusCode, 200)
|
|
})
|