2018-06-22 20:54:14 +02:00
|
|
|
import {HTTP_STATUS} from "../../../src/lib/constants";
|
2017-10-24 16:02:08 +02:00
|
|
|
|
2018-06-22 20:54:14 +02:00
|
|
|
export default function (server2) {
|
|
|
|
describe('test plugin middlewares', () => {
|
|
|
|
test('should serve the registered route ES5', () => {
|
2017-10-24 16:02:08 +02:00
|
|
|
return server2.request({
|
|
|
|
uri: '/test/route',
|
|
|
|
method: 'GET'
|
|
|
|
})
|
2018-06-22 20:54:14 +02:00
|
|
|
.status(HTTP_STATUS.OK)
|
2017-10-24 16:02:08 +02:00
|
|
|
.body_ok('this is a custom route')
|
|
|
|
})
|
2018-06-22 20:54:14 +02:00
|
|
|
|
|
|
|
test('should serve the registered route ES6', () => {
|
|
|
|
return server2.request({
|
|
|
|
uri: '/test/route/es6',
|
|
|
|
method: 'GET'
|
|
|
|
})
|
|
|
|
.status(HTTP_STATUS.OK)
|
|
|
|
.body_ok('this is a custom route es6')
|
|
|
|
})
|
2017-10-24 16:02:08 +02:00
|
|
|
})
|
|
|
|
}
|