This commit is contained in:
2025-05-21 04:18:42 +03:30
commit d5aff06ada
18 changed files with 4718 additions and 0 deletions

28
test/routes/root.test.js Normal file
View File

@@ -0,0 +1,28 @@
'use strict'
const { test } = require('node:test')
const assert = require('node:assert')
const { build } = require('../helper')
test('default root route', async (t) => {
const app = await build(t)
const res = await app.inject({
url: '/'
})
assert.deepStrictEqual(JSON.parse(res.payload), { root: true })
})
// inject callback style:
//
// test('default root route', (t) => {
// t.plan(2)
// const app = await build(t)
//
// app.inject({
// url: '/'
// }, (err, res) => {
// t.error(err)
// assert.deepStrictEqual(JSON.parse(res.payload), { root: true })
// })
// })