From 0b1fbd32c0c2b44cbc494b523c00cb0b9bf8aedd Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 7 Oct 2017 00:53:37 +0400 Subject: Changed structure of the test --- src/tests/index.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/tests/index.js b/src/tests/index.js index 7a85db3..176d192 100644 --- a/src/tests/index.js +++ b/src/tests/index.js @@ -3,14 +3,27 @@ import { assert } from 'chai'; import Containers from '../lib/index'; describe('simple-container:', () => { - it('simple', (done) => { + var container = null; + + before((done) => { var containers = new Containers(); var image = 'hello-world:latest'; - containers.create(image).then(container => { - if (container) { + containers.create(image).then(item => { + container = item; + done(); + }); + }); + + after((done) => { + container.stop(() => { + container.remove(() => { done(); - } + }); }); }); + + it('simple', () => { + assert.isString(container.id); + }); }); \ No newline at end of file -- cgit v1.2.3