1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 14:10:04 +02:00

chore: lint cleanup in compose-client

This commit is contained in:
geek 2017-06-04 19:25:06 -05:00 committed by Sérgio Ramos
parent 37bd108f40
commit 123eafbb5c

View File

@ -1,19 +1,16 @@
'use strict';
const { expect } = require('code');
const Lab = require('lab');
const Package = require('../package.json');
const { safeLoad } = require('js-yaml');
const { Server } = require('zerorpc');
// Test shortcuts
const lab = exports.lab = Lab.script();
const lab = Lab.script();
exports.lab = lab;
const after = lab.after;
const it = lab.it;
const projectName = Package.name;
const endpoint = 'tcp://0.0.0.0:4040';
const DockerComposeClient = require('../');
@ -77,7 +74,7 @@ const server = new Server({
server.bind(endpoint);
it('provision()', (done) => {
it('provision()', done => {
const manifest = `
hello:
image: hello-world:latest
@ -95,7 +92,7 @@ it('provision()', (done) => {
});
});
it('scale()', (done) => {
it('scale()', done => {
const manifest = `
hello:
image: hello-world:latest
@ -105,14 +102,16 @@ it('scale()', (done) => {
image: node:latest
`;
client.scale({
client.scale(
{
projectName,
services: {
hello: 2,
world: 3
},
manifest
}, (err, res) => {
},
(err, res) => {
expect(err).to.not.exist();
expect(res).to.equal({
@ -120,11 +119,12 @@ it('scale()', (done) => {
services: [{ name: 'hello', num: 2 }, { name: 'world', num: 3 }]
});
done();
});
}
);
});
it('handles errors', (done) => {
client.once('error', (err) => {
it('handles errors', done => {
client.once('error', err => {
expect(err).to.exist();
done();
});
@ -132,7 +132,7 @@ it('handles errors', (done) => {
client.client.emit('error', new Error('test'));
});
after((done) => {
after(done => {
client.close();
server.close();
done();