mirror of
https://github.com/yldio/copilot.git
synced 2024-12-01 07:30:07 +02:00
chore: lint cleanup in compose-client
This commit is contained in:
parent
37bd108f40
commit
123eafbb5c
@ -1,19 +1,16 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
const { expect } = require('code');
|
const { expect } = require('code');
|
||||||
const Lab = require('lab');
|
const Lab = require('lab');
|
||||||
const Package = require('../package.json');
|
const Package = require('../package.json');
|
||||||
const { safeLoad } = require('js-yaml');
|
const { safeLoad } = require('js-yaml');
|
||||||
const { Server } = require('zerorpc');
|
const { Server } = require('zerorpc');
|
||||||
|
|
||||||
|
|
||||||
// Test shortcuts
|
// Test shortcuts
|
||||||
|
|
||||||
const lab = exports.lab = Lab.script();
|
const lab = Lab.script();
|
||||||
|
exports.lab = lab;
|
||||||
const after = lab.after;
|
const after = lab.after;
|
||||||
const it = lab.it;
|
const it = lab.it;
|
||||||
|
|
||||||
|
|
||||||
const projectName = Package.name;
|
const projectName = Package.name;
|
||||||
const endpoint = 'tcp://0.0.0.0:4040';
|
const endpoint = 'tcp://0.0.0.0:4040';
|
||||||
const DockerComposeClient = require('../');
|
const DockerComposeClient = require('../');
|
||||||
@ -77,7 +74,7 @@ const server = new Server({
|
|||||||
|
|
||||||
server.bind(endpoint);
|
server.bind(endpoint);
|
||||||
|
|
||||||
it('provision()', (done) => {
|
it('provision()', done => {
|
||||||
const manifest = `
|
const manifest = `
|
||||||
hello:
|
hello:
|
||||||
image: hello-world:latest
|
image: hello-world:latest
|
||||||
@ -95,7 +92,7 @@ it('provision()', (done) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('scale()', (done) => {
|
it('scale()', done => {
|
||||||
const manifest = `
|
const manifest = `
|
||||||
hello:
|
hello:
|
||||||
image: hello-world:latest
|
image: hello-world:latest
|
||||||
@ -105,14 +102,16 @@ it('scale()', (done) => {
|
|||||||
image: node:latest
|
image: node:latest
|
||||||
`;
|
`;
|
||||||
|
|
||||||
client.scale({
|
client.scale(
|
||||||
|
{
|
||||||
projectName,
|
projectName,
|
||||||
services: {
|
services: {
|
||||||
hello: 2,
|
hello: 2,
|
||||||
world: 3
|
world: 3
|
||||||
},
|
},
|
||||||
manifest
|
manifest
|
||||||
}, (err, res) => {
|
},
|
||||||
|
(err, res) => {
|
||||||
expect(err).to.not.exist();
|
expect(err).to.not.exist();
|
||||||
|
|
||||||
expect(res).to.equal({
|
expect(res).to.equal({
|
||||||
@ -120,11 +119,12 @@ it('scale()', (done) => {
|
|||||||
services: [{ name: 'hello', num: 2 }, { name: 'world', num: 3 }]
|
services: [{ name: 'hello', num: 2 }, { name: 'world', num: 3 }]
|
||||||
});
|
});
|
||||||
done();
|
done();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles errors', (done) => {
|
it('handles errors', done => {
|
||||||
client.once('error', (err) => {
|
client.once('error', err => {
|
||||||
expect(err).to.exist();
|
expect(err).to.exist();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@ -132,7 +132,7 @@ it('handles errors', (done) => {
|
|||||||
client.client.emit('error', new Error('test'));
|
client.client.emit('error', new Error('test'));
|
||||||
});
|
});
|
||||||
|
|
||||||
after((done) => {
|
after(done => {
|
||||||
client.close();
|
client.close();
|
||||||
server.close();
|
server.close();
|
||||||
done();
|
done();
|
||||||
|
Loading…
Reference in New Issue
Block a user