Skip to content

Commit

Permalink
tests: add test for 404 path in app
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Mar 9, 2015
1 parent 6430bf6 commit 894b189
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ describe('express(1)', function () {
.get('/')
.expect(200, /<title>Express<\/title>/, done);
});

it('should generate a 404', function (done) {
var file = path.resolve(dir, 'app.js');
var app = require(file);

request(app)
.get('/does_not_exist')
.expect(404, /<h1>Not Found<\/h1>/, done);
});
});

describe('--ejs', function () {
Expand Down Expand Up @@ -162,6 +171,15 @@ describe('express(1)', function () {
.get('/')
.expect(200, /<title>Express<\/title>/, done);
});

it('should generate a 404', function (done) {
var file = path.resolve(dir, 'app.js');
var app = require(file);

request(app)
.get('/does_not_exist')
.expect(404, /<h1>Not Found<\/h1>/, done);
});
});

describe('--git', function () {
Expand Down Expand Up @@ -301,6 +319,15 @@ describe('express(1)', function () {
.get('/')
.expect(200, /<title>Express<\/title>/, done);
});

it('should generate a 404', function (done) {
var file = path.resolve(dir, 'app.js');
var app = require(file);

request(app)
.get('/does_not_exist')
.expect(404, /<h1>Not Found<\/h1>/, done);
});
});

describe('--help', function () {
Expand Down

0 comments on commit 894b189

Please sign in to comment.