Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created July 4, 2014 00:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save miguelmota/69e7623d11cd8455b9b9 to your computer and use it in GitHub Desktop.
Save miguelmota/69e7623d11cd8455b9b9 to your computer and use it in GitHub Desktop.
Node SuperTest simple example
var test = require('tape');
var request = require('supertest');
var server = require('../../server');
test('barcode route', function(t) {
request(server)
.get('/api/1/code')
.expect(200)
.expect('Content-Type', /json/)
.expect({"code":{"code":"1M4A67AE3H94RS6GG74M"}})
.end(function(err, res) {
t.error(err);
t.end();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment