Last active
October 20, 2018 17:25
-
-
Save zac11/5c20f9ce7ca4b4189c5adecee43e7e98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const supertest = require('supertest'); | |
const expect = require('chai').expect; | |
const schema = require('../validation/list_users_schema'); | |
const joi = require('joi'); | |
let baseURL = supertest("https://reqres.in"); | |
let list_users = "/api/users"; | |
describe('POST Request',()=>{ | |
let post_resp; | |
it('makes a POST call ',async ()=>{ | |
post_resp = await baseURL.post(list_users) | |
.type('form') | |
.send({ | |
"name": "morpheus", | |
"job": "leader" | |
}) | |
.set('Accept','/application/\json/'); | |
await (console.log(post_resp.body)); | |
}); | |
it('asserts that the response code is 201',async ()=>{ | |
await (expect(post_resp.status).to.eql(201)); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment