-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from alphagov/andymantell-basic-sanity-check-…
…test-suite Basic sanity check test suite
- Loading branch information
Showing
6 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,3 +206,5 @@ utils.findAvailablePort(app, function (port) { | |
}) | ||
} | ||
}) | ||
|
||
module.exports = app |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--recursive |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-env mocha */ | ||
var request = require('supertest') | ||
var app = require('../../server.js') | ||
var path = require('path') | ||
var fs = require('fs') | ||
var assert = require('assert') | ||
|
||
/** | ||
* Basic sanity checks on the dev server | ||
*/ | ||
describe('The prototype kit', function () { | ||
it('should generate assets into the /public folder', function () { | ||
assert.doesNotThrow(function () { | ||
fs.accessSync(path.resolve(__dirname, '../../public/javascripts/application.js')) | ||
fs.accessSync(path.resolve(__dirname, '../../public/images/favicon.ico')) | ||
fs.accessSync(path.resolve(__dirname, '../../public/stylesheets/application.css')) | ||
}) | ||
}) | ||
|
||
it('should send with a well formed response for the index page', function (done) { | ||
request(app) | ||
.get('/') | ||
.expect('Content-Type', /text\/html/) | ||
.expect(200) | ||
.end(function (err, res) { | ||
if (err) { | ||
done(err) | ||
} else { | ||
done() | ||
} | ||
}) | ||
}) | ||
}) |