stuff
This commit is contained in:
Regular → Executable
+2
-2
@@ -5,7 +5,6 @@ import type { Config } from '@japa/runner/types'
|
||||
import { pluginAdonisJS } from '@japa/plugin-adonisjs'
|
||||
import testUtils from '@adonisjs/core/services/test_utils'
|
||||
|
||||
|
||||
/**
|
||||
* This file is imported by the "bin/test.ts" entrypoint file
|
||||
*/
|
||||
@@ -19,7 +18,8 @@ export const plugins: Config['plugins'] = [
|
||||
apiClient({
|
||||
baseURL: 'http://localhost:3333',
|
||||
}),
|
||||
pluginAdonisJS(app)]
|
||||
pluginAdonisJS(app),
|
||||
]
|
||||
|
||||
/**
|
||||
* Configure lifecycle function to run before and after all the
|
||||
|
||||
Regular → Executable
+2
-14
@@ -1,21 +1,9 @@
|
||||
import { test } from '@japa/runner'
|
||||
|
||||
test.group('Restaurant menu items', () => {
|
||||
test('create', async ({ assert, client }) => {
|
||||
const item = {
|
||||
name: 'test',
|
||||
priceSmall: 10,
|
||||
priceLarge: 20,
|
||||
description: 'test'
|
||||
}
|
||||
const response = await client.post('/api/menu-items/create').json(item)
|
||||
assert.equal(response.body().name, item.name)
|
||||
assert.equal(response.body().priceSmall, item.priceSmall)
|
||||
assert.equal(response.body().priceLarge, item.priceLarge)
|
||||
assert.equal(response.body().description, item.description)
|
||||
}),
|
||||
test('get all', async ({ assert, client }) => {
|
||||
const response = await client.get('/api/menu-items')
|
||||
assert.equal(response.status(), 200)
|
||||
assert.isArray(response.body())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user