Created
July 2, 2014 17:29
-
-
Save thebergamo/5ae49e68791dc8549cce to your computer and use it in GitHub Desktop.
test_user.js
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
var request = require('request'); | |
var assert = require('assert'); | |
describe('API / USER Test', function(){ | |
//test get list | |
describe('GET /api/users', function(){ | |
it('code 200 && array', function(done){ | |
request('http://localhost:8080/api/users', function(err, res){ | |
assert.equal(res.statusCode, 200); | |
assert.ok(typeof JSON.parse(res.body) === "object"); | |
done(); | |
}); | |
}); | |
}); | |
}); |
alanhoff
commented
Jul 2, 2014
- Testes sempre devem ser feitos em um ambiente zerado, sem interferências externas
- Os testes são mais fáceis se seguir a ordem do CRUD.
- 2 espaços, meh.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment