mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 19:10:38 +02:00
Asset request, describe more tests
This commit is contained in:
11
test/test.js
11
test/test.js
@@ -183,15 +183,22 @@ describe("Server", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Test the home page
|
// Test the home page
|
||||||
it("should return a 200", function(done) {
|
it("should return a 200 (home page)", function(done) {
|
||||||
request.get("http://localhost:3000", function(error, res, body) {
|
request.get("http://localhost:3000", function(error, res, body) {
|
||||||
assert.equal(200, res.statusCode);
|
assert.equal(200, res.statusCode);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should return a 200 (asset request)", function(done) {
|
||||||
|
request.get("http://localhost:3000/stylesheets/style.css", function(error, res, body) {
|
||||||
|
assert.equal(200, res.statusCode);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// invalid method, we only allow GET and HEAD requests
|
// invalid method, we only allow GET and HEAD requests
|
||||||
it("should return a 405", function(done) {
|
it("should return a 405 (invalid method)", function(done) {
|
||||||
request.post("http://localhost:3000", function(error, res, body) {
|
request.post("http://localhost:3000", function(error, res, body) {
|
||||||
assert.equal(405, res.statusCode);
|
assert.equal(405, res.statusCode);
|
||||||
done();
|
done();
|
||||||
|
|||||||
Reference in New Issue
Block a user