aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-10-09 19:21:01 +0300
committerValentin Popov <info@valentineus.link>2017-10-09 19:21:01 +0300
commit38d1a0eab11062da2d900d8d0fac787688d359ea (patch)
treecf729aefcb47c11a3c9ed5353662b85d791ddc3c
parente7de2b9a1ba81463db4f696249193d51754ec864 (diff)
downloadiii-client-38d1a0eab11062da2d900d8d0fac787688d359ea.tar.xz
iii-client-38d1a0eab11062da2d900d8d0fac787688d359ea.zip
Add cyclic testing
-rw-r--r--src/test.js36
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