Skip to content

Instantly share code, notes, and snippets.

@farisadln
Last active March 23, 2021 14:03
Show Gist options
  • Save farisadln/f4de1d86711e2be054ec71b9a84195e1 to your computer and use it in GitHub Desktop.
Save farisadln/f4de1d86711e2be054ec71b9a84195e1 to your computer and use it in GitHub Desktop.
describe("Test get data from jsonplaceholder", function () {
it("Success", function (done) {
api
.get("/posts/1") // karena kita ingin mengabl data maka kita menggunaka 'get' dan "/post/1" adalah endpoint yang di tuju
.set("Content-type", "application/json")
.end(function (err, res) {
// kita dapat melakukan response assertion cirteria yang kita inginkan
expect(res.status).to.equals(200);
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment