diff options
author | Valentin Popov <info@valentineus.link> | 2017-10-09 19:21:01 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2017-10-09 19:21:01 +0300 |
commit | 38d1a0eab11062da2d900d8d0fac787688d359ea (patch) | |
tree | cf729aefcb47c11a3c9ed5353662b85d791ddc3c /src | |
parent | e7de2b9a1ba81463db4f696249193d51754ec864 (diff) | |
download | iii-client-38d1a0eab11062da2d900d8d0fac787688d359ea.tar.xz iii-client-38d1a0eab11062da2d900d8d0fac787688d359ea.zip |
Add cyclic testing
Diffstat (limited to 'src')
-rw-r--r-- | src/test.js | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/test.js b/src/test.js index f0d1431..1c34e5f 100644 --- a/src/test.js +++ b/src/test.js @@ -29,16 +29,36 @@ describe('iii-client:', () => { }); it('connect():', (done) => { - connect(uuid, (request) => { - assert.isObject(request); - done(); - }); + var value = 0; + var test = () => { + connect(uuid, (request) => { + if (!typeof request === 'object' && value++ < 5) { + test(); + } + else { + assert.isObject(request); + done(); + } + }); + } + + test(); }); it('send():', (done) => { - send(uuid, text, (request) => { - assert.isObject(request); - done(); - }); + var value = 0; + var test = () => { + send(uuid, text, (request) => { + if (!typeof request === 'object' && value++ < 5) { + test(); + } + else { + assert.isObject(request); + done(); + } + }); + } + + test(); }); });
\ No newline at end of file |