Skip to content

Instantly share code, notes, and snippets.

@erik-haartmans
Created November 5, 2017 00:01
Show Gist options
  • Save erik-haartmans/74d592d5f5335150e224112b2f13885c to your computer and use it in GitHub Desktop.
Save erik-haartmans/74d592d5f5335150e224112b2f13885c to your computer and use it in GitHub Desktop.
const chai = require('chai');
chai.should();
const request = require('supertest')('http://api.icndb.com/jokes');
describe('chuck norris query parameters test suite', () => {
it('should be able to use query parameters', async () => {
const response = await request.get('/random')
.query({
firstName: 'John',
lastName: 'Doe'
});
response.statusCode.should.equal(200, 'response status should equal 200');
console.log(response.body.value.joke);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment