aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-06 23:53:37 +0300
committerValentin Popov <info@valentineus.link>2017-10-06 23:53:37 +0300
commit0b1fbd32c0c2b44cbc494b523c00cb0b9bf8aedd (patch)
tree7ea9f1bd423650df46fd02750165ce889813bf10 /src/tests
parentad3924b45e5618f8350f4f24c19dadb5926e3e42 (diff)
downloadsimple-container-0b1fbd32c0c2b44cbc494b523c00cb0b9bf8aedd.tar.xz
simple-container-0b1fbd32c0c2b44cbc494b523c00cb0b9bf8aedd.zip
Changed structure of the test
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/index.js21
1 files changed, 17 insertions, 4 deletions
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