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