2021-03-14 08:42:46 +01: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', () => {
|
2021-03-14 08:42:46 +01:00
|
|
|
return server2
|
|
|
|
.request({
|
|
|
|
uri: '/test/route',
|
2022-01-09 20:51:50 +01:00
|
|
|
method: 'GET',
|
2021-03-14 08:42:46 +01:00
|
|
|
})
|
2019-07-16 08:40:01 +02:00
|
|
|
.status(HTTP_STATUS.OK)
|
2021-03-14 08:42:46 +01:00
|
|
|
.body_ok('this is a custom route');
|
|
|
|
});
|
2018-06-22 20:54:14 +02:00
|
|
|
|
|
|
|
test('should serve the registered route ES6', () => {
|
2021-03-14 08:42:46 +01:00
|
|
|
return server2
|
|
|
|
.request({
|
|
|
|
uri: '/test/route/es6',
|
2022-01-09 20:51:50 +01:00
|
|
|
method: 'GET',
|
2021-03-14 08:42:46 +01:00
|
|
|
})
|
2018-06-22 20:54:14 +02:00
|
|
|
.status(HTTP_STATUS.OK)
|
2021-03-14 08:42:46 +01:00
|
|
|
.body_ok('this is a custom route es6');
|
|
|
|
});
|
|
|
|
});
|
2017-10-24 16:02:08 +02:00
|
|
|
}
|