Skip to content

Instantly share code, notes, and snippets.

@squizzi
Created June 11, 2018 22:06
Show Gist options
  • Save squizzi/0f0162132829ae9c21bb296eb20d125b to your computer and use it in GitHub Desktop.
Save squizzi/0f0162132829ae9c21bb296eb20d125b to your computer and use it in GitHub Desktop.
Replace tests/api-spec.js with this file
var request = require('request');
var base_url = "http://api:8080/";
describe("When testing 'api/pet'", function(){
it("should respond with the URL of a cat GIF", function(done) {
request(base_url + 'api/pet', function(error, response, body){
expect(body).toMatch(/\{"imageId":\d+,"url":"http(s?):/);
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment