In this post, we'll take a look at what tools/technologies do we need for writing API tests using JavaScript and then we'll also write our first API test. So let's get started... ⚙️ Dependencies: First off, we'll need to get the following dependencies installed to set up our base framework - (to install the packages below) Node JS and NPM (for test framework) Mocha JS (for assertions) Chai JS (for making API calls) SuperTest (to use ES6+ in our tests) Babel Note: the above libraries/frameworks are optional to use, you can replace any one or all of them to meet your desired goals. Setup Your Project You can watch the installation video below to see how to install all these packages and get your project setup: Write an API Test Once you have your project setup, we will begin to write our API test in the users.js file (created as part of the installation video above). supertest ; request = supertest( ); { expect } ; TOKEN = {your_token_here} describe( , () => { it( , (done) => { request.get( ).end( { expect(res.body.data).to.not.be.empty; done(); }); }); }); import from 'supertest' const 'https://gorest.co.in/public-api/' import from 'chai' // watch the installation video to create your token const 'Users' 'GET /users' // make a GET call to the users api `users?access-token= ` ${TOKEN} ( ) => err, res // assertion to ensure data is not empty // done callback to handle async calls Run Your Test Now, its time to run your test, you can do that by running the command or doing which will also run the same command if you followed the installation video. mocha npm test mocha There you go, we just created our first API test and it ran successfully 🙌. Check out this video to see a detailed explanation on how to write your first API test: You can also clone the to access this code GitHub repo To learn more about API testing, check out my free tutorial series here - I hope this post helped you out, let me know in the comments below! Happy testing! 😄 Subscribe to my channel YouTube Support my work - https://www.buymeacoffee.com/automationbro Follow on Twitter @automationbro Also published at https://dev.to/automationbro/writing-your-first-api-test-using-javascript-15l2