@@ -5,11 +5,7 @@ import { createApp } from '../src';
55describe ( 'handler' , ( ) => {
66 describe ( 'validation' , ( ) => {
77 it ( 'should error on invalid parameters' , async ( ) => {
8- const app = createApp ( {
9- hostname : 'localhost' ,
10- port : 3000 ,
11- cors : [ ] ,
12- } ) . route ( {
8+ const app = createApp ( { } ) . route ( {
139 path : '/users/:userId/invoices/:invoiceId' ,
1410 method : 'get' ,
1511 validation : {
@@ -54,11 +50,7 @@ Object {
5450 } ) ;
5551
5652 it ( 'should error on invalid query' , async ( ) => {
57- const app = createApp ( {
58- hostname : 'localhost' ,
59- port : 3000 ,
60- cors : [ ] ,
61- } ) . route ( {
53+ const app = createApp ( { } ) . route ( {
6254 path : '/users' ,
6355 method : 'get' ,
6456 validation : {
@@ -98,11 +90,7 @@ Object {
9890 } ) ;
9991
10092 it ( 'should error on invalid payload' , async ( ) => {
101- const app = createApp ( {
102- hostname : 'localhost' ,
103- port : 3000 ,
104- cors : [ ] ,
105- } ) . route ( {
93+ const app = createApp ( { } ) . route ( {
10694 path : '/users' ,
10795 method : 'post' ,
10896 validation : {
@@ -152,11 +140,7 @@ Object {
152140 } ) ;
153141
154142 it ( 'should return 500 on invalid response' , async ( ) => {
155- const app = createApp ( {
156- hostname : 'localhost' ,
157- port : 3000 ,
158- cors : [ ] ,
159- } ) . route ( {
143+ const app = createApp ( { } ) . route ( {
160144 path : '/users' ,
161145 method : 'get' ,
162146 validation : {
@@ -184,11 +168,7 @@ Object {
184168 } ) ;
185169
186170 it ( 'should parse and validate query, params and payload' , async ( ) => {
187- const app = createApp ( {
188- hostname : 'localhost' ,
189- port : 3000 ,
190- cors : [ ] ,
191- } ) . route ( {
171+ const app = createApp ( { } ) . route ( {
192172 path : '/users/:userId/invoices/:invoiceId' ,
193173 method : 'post' ,
194174 validation : {
@@ -222,11 +202,7 @@ Object {
222202
223203 describe ( 'happy path' , ( ) => {
224204 it ( 'should return data when all validation passes' , async ( ) => {
225- const app = createApp ( {
226- hostname : 'localhost' ,
227- port : 3000 ,
228- cors : [ ] ,
229- } ) . route ( {
205+ const app = createApp ( { } ) . route ( {
230206 path : '/users/:userId/invoices/:invoiceId' ,
231207 method : 'post' ,
232208 validation : {
@@ -256,11 +232,7 @@ Object {
256232 } ) ;
257233
258234 it ( 'should return 204 on empty response' , async ( ) => {
259- const app = createApp ( {
260- hostname : 'localhost' ,
261- port : 3000 ,
262- cors : [ ] ,
263- } ) . route ( {
235+ const app = createApp ( { } ) . route ( {
264236 path : '/users' ,
265237 method : 'get' ,
266238 validation : { } ,
@@ -278,11 +250,7 @@ Object {
278250 const uniqueRequestIds = new Set < string > ( ) ;
279251 const uniqueServerIds = new Set < string > ( ) ;
280252
281- const app = createApp ( {
282- hostname : 'localhost' ,
283- port : 3000 ,
284- cors : [ ] ,
285- } ) . route ( {
253+ const app = createApp ( { } ) . route ( {
286254 path : '/users' ,
287255 method : 'get' ,
288256 validation : { } ,
0 commit comments