@@ -15,7 +15,7 @@ beforeAll((done) => {
1515test ( "It should return 404 endpoint error" , ( ) => {
1616 return request ( app ) . get ( "/v2" ) . then ( response => {
1717 expect ( response . statusCode ) . toBe ( 404 )
18- expect ( response . text ) . toContain ( "No Endpoint Found " )
18+ expect ( response . text ) . toContain ( "No results found " )
1919 } )
2020} )
2121
@@ -103,8 +103,8 @@ test("It should return LC-39A info", () => {
103103
104104test ( "It should return no launchpads found info" , ( ) => {
105105 return request ( app ) . get ( "/v1/launchpads/ksc_lc_40a" ) . then ( response => {
106- expect ( response . statusCode ) . toBe ( 200 )
107- expect ( response . text ) . toContain ( "No Matches Found " )
106+ expect ( response . statusCode ) . toBe ( 404 )
107+ expect ( response . text ) . toContain ( "No results found " )
108108 } )
109109} )
110110
@@ -135,8 +135,8 @@ test("It should return all past launches from LC-4E", () => {
135135
136136test ( "It should return no launches from made up launchpad" , ( ) => {
137137 return request ( app ) . get ( "/v1/launches?site=vafb_slc_5e" ) . then ( response => {
138- expect ( response . statusCode ) . toBe ( 200 )
139- expect ( response . text ) . toContain ( "No Matches Found " )
138+ expect ( response . statusCode ) . toBe ( 404 )
139+ expect ( response . text ) . toContain ( "No results found " )
140140 } )
141141} )
142142
@@ -149,8 +149,8 @@ test("It should return all 2012 launches", () => {
149149
150150test ( "It should return no 2005 launches" , ( ) => {
151151 return request ( app ) . get ( "/v1/launches?year=2005" ) . then ( response => {
152- expect ( response . statusCode ) . toBe ( 200 )
153- expect ( response . text ) . toContain ( "No Matches Found " )
152+ expect ( response . statusCode ) . toBe ( 404 )
153+ expect ( response . text ) . toContain ( "No results found " )
154154 } )
155155} )
156156
@@ -162,8 +162,8 @@ test("It should return past launches in timeframe", () => {
162162
163163test ( "It should return no past launches in timeframe" , ( ) => {
164164 return request ( app ) . get ( "/v1/launches?start=2005-01-20&final=2005-05-25" ) . then ( response => {
165- expect ( response . statusCode ) . toBe ( 200 )
166- expect ( response . text ) . toContain ( "No Matches Found " )
165+ expect ( response . statusCode ) . toBe ( 404 )
166+ expect ( response . text ) . toContain ( "No results found " )
167167 } )
168168} )
169169
@@ -176,8 +176,8 @@ test("It should return all launches with core B1021", () => {
176176
177177test ( "It should return no launches with core A1021" , ( ) => {
178178 return request ( app ) . get ( "/v1/launches/cores/A1021" ) . then ( response => {
179- expect ( response . statusCode ) . toBe ( 200 )
180- expect ( response . text ) . toContain ( "No Matches Found " )
179+ expect ( response . statusCode ) . toBe ( 404 )
180+ expect ( response . text ) . toContain ( "No results found " )
181181 } )
182182} )
183183
@@ -190,8 +190,8 @@ test("It should return all launches with cap C106", () => {
190190
191191test ( "It should return no launches with cap C403" , ( ) => {
192192 return request ( app ) . get ( "/v1/launches/caps/C403" ) . then ( response => {
193- expect ( response . statusCode ) . toBe ( 200 )
194- expect ( response . text ) . toContain ( "No Matches Found " )
193+ expect ( response . statusCode ) . toBe ( 404 )
194+ expect ( response . text ) . toContain ( "No results found " )
195195 } )
196196} )
197197
@@ -227,21 +227,21 @@ test("It should return all upcoming launches in 2017", () => {
227227
228228test ( "It should return no upcoming launches in 2016" , ( ) => {
229229 return request ( app ) . get ( "/v1/launches/upcoming?year=2016" ) . then ( response => {
230- expect ( response . statusCode ) . toBe ( 200 )
231- expect ( response . text ) . toContain ( "No Matches Found " )
230+ expect ( response . statusCode ) . toBe ( 404 )
231+ expect ( response . text ) . toContain ( "No results found " )
232232 } )
233233} )
234234
235235test ( "It should return all launches in the timeframe" , ( ) => {
236236 return request ( app ) . get ( "/v1/launches/upcoming?start=2011-01-20&final=2017-05-25" ) . then ( response => {
237- expect ( response . statusCode ) . toBe ( 200 )
237+ expect ( response . statusCode ) . toBe ( 404 )
238238 } )
239239} )
240240
241241test ( "It should return no launches in the timeframe" , ( ) => {
242242 return request ( app ) . get ( "/v1/launches/upcoming?start=2011-01-20&final=2016-05-25" ) . then ( response => {
243- expect ( response . statusCode ) . toBe ( 200 )
244- expect ( response . text ) . toContain ( "No Matches Found " )
243+ expect ( response . statusCode ) . toBe ( 404 )
244+ expect ( response . text ) . toContain ( "No results found " )
245245 } )
246246} )
247247
@@ -266,8 +266,8 @@ test("It should return all info on C106", () => {
266266
267267test ( "It should return no info on C406" , ( ) => {
268268 return request ( app ) . get ( "/v1/parts/caps/C406" ) . then ( response => {
269- expect ( response . statusCode ) . toBe ( 200 )
270- expect ( response . text ) . toContain ( "No Matches Found " )
269+ expect ( response . statusCode ) . toBe ( 404 )
270+ expect ( response . text ) . toContain ( "No results found " )
271271 } )
272272} )
273273
@@ -288,7 +288,7 @@ test("It should return core info on B1021", () => {
288288
289289test ( "It should return no core info on A1021" , ( ) => {
290290 return request ( app ) . get ( "/v1/parts/cores/A1021" ) . then ( response => {
291- expect ( response . statusCode ) . toBe ( 200 )
292- expect ( response . text ) . toContain ( "No Matches Found " )
291+ expect ( response . statusCode ) . toBe ( 404 )
292+ expect ( response . text ) . toContain ( "No results found " )
293293 } )
294294} )
0 commit comments