Add labrc and satisfy the linter

parent e0c964e2
module.exports = {
coverage: true,
threshold: 90,
lint: true,
"lint-warnings-threshold": 1000
};
......@@ -3,20 +3,21 @@
const Hapi = require('hapi');
// Load models
var models = glob.sync("models/**/*.js");
models.forEach(function (modelPath) {
require(path.resolve(modelPath));
const models = glob.sync('models/**/*.js');
models.forEach((modelPath) => {
require(path.resolve(modelPath));
});
const server = new Hapi.Server();
server.connection({ port: 3000, host: 'localhost' });
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello, world!');
}
method: 'GET',
path: '/',
handler: (request, reply) => {
reply('Hello, world!');
}
});
server.start((err) => {
......
......@@ -15,39 +15,39 @@ let server;
lab.beforeEach((done) => {
const plugins = [Vision, HomePlugin];
server = new Hapi.Server();
server.connection({ port: Config.get('/port/web') });
server.register(plugins, (err) => {
if (err) {
return done(err);
}
server.views({
engines: { jade: require('jade') },
path: './server/web'
});
const plugins = [Vision, HomePlugin];
server = new Hapi.Server();
server.connection({ port: Config.get('/port/web') });
server.register(plugins, (err) => {
if (err) {
return done(err);
}
done();
});
server.views({
engines: { jade: require('jade') },
path: './server/web'
});
done();
});
});
lab.experiment('/', () => {
lab.beforeEach((done) => {
request = {
method: 'GET',
url: '/'
};
done();
});
lab.test('home page renders properly', (done) => {
server.inject(request, (response) => {
Code.expect(response.statusCode).to.equal(200);
done();
lab.beforeEach((done) => {
request = {
method: 'GET',
url: '/'
};
done();
});
lab.test('home page renders properly', (done) => {
server.inject(request, (response) => {
Code.expect(response.statusCode).to.equal(200);
done();
});
});
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment