Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Library to Test API Endpoints [closed]

I am looking for a simple API for testing rest API. I would like to be able to keep the mocha and/or jasmine asserts structure, while chaining the API data, verb etc.

api( '/maker' )
   .put(
     return {
       name: 'Sample 1',
       type: 'cheese',
       country: 'United States'
     }
   )
   .failed()
   .succussed().
   .has(
     return {
       assert(1, 1)
     }
   );
like image 696
d1b1 Avatar asked Dec 16 '22 10:12

d1b1


1 Answers

supertest https://github.com/visionmedia/supertest does exactly what you're looking for.

like image 78
Dan Kohn Avatar answered Dec 28 '22 20:12

Dan Kohn