Fix JSCS errors

This commit is contained in:
Rowan Manning
2016-04-25 21:26:59 +01:00
parent 90328cfa39
commit ea48d6a6fd
31 changed files with 366 additions and 364 deletions

View File

@@ -22,24 +22,24 @@ var loadFixtures = require('pa11y-webservice/data/fixture/load');
var request = require('request');
// Run before all tests
before(function (done) {
before(function(done) {
this.baseUrl = 'http://localhost:' + config.port;
this.last = {};
this.navigate = createNavigator(this.baseUrl, this.last);
this.webservice = createWebserviceClient(config);
assertTestAppIsRunning(this.baseUrl, function () {
assertTestAppIsRunning(this.baseUrl, function() {
loadFixtures('test', config.webservice, done);
});
});
// Run after each test
afterEach(function (done) {
afterEach(function(done) {
loadFixtures('test', config.webservice, done);
});
// Check that the test application is running, and exit if not
function assertTestAppIsRunning (url, done) {
request(url, function (err) {
function assertTestAppIsRunning(url, done) {
request(url, function(err) {
if (err) {
console.error('Error: Test app not started; run with `NODE_ENV=test node index.js`');
process.exit(1);