Skip to content

Instantly share code, notes, and snippets.

@ianaya89
Created November 7, 2021 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianaya89/74f3a55b015f42938ab10d628145f60d to your computer and use it in GitHub Desktop.
Save ianaya89/74f3a55b015f42938ab10d628145f60d to your computer and use it in GitHub Desktop.
const axios = require('axios')
const assert = require('assert')
async function run () {
const { data: users } = await axios.get('https://reqres.in/api/users')
assert.equal(users.data.length, 6)
const { data: user } = await axios.get('https://reqres.in/api/users/' + users.data[0].id)
assert.equal(user.data.first_name, 'George')
}
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment