From 6c335b666210b8765be0a4a041517c37eadac239 Mon Sep 17 00:00:00 2001 From: Amine Ben hammou Date: Sun, 29 Oct 2017 13:15:55 +0100 Subject: [PATCH] bug fixes --- README.md | 2 ++ package.json | 2 +- src/generate.js | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7673716..69ffb42 100644 --- a/README.md +++ b/README.md @@ -268,6 +268,8 @@ When `children` are specified, the following steps are added to the testing sena # Changelog +- **Version 1.0.7**: bug fixes. + - **Version 1.0.6**: bug fixes. - **Version 1.0.5**: option `prefix` added. diff --git a/package.json b/package.json index d9ab7c5..b3e3f93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wajez-api-test", - "version": "1.0.6", + "version": "1.0.7", "description": "Testing REST API made easy.", "main": "src/index.js", "scripts": { diff --git a/src/generate.js b/src/generate.js index 35a12c0..9824d4d 100644 --- a/src/generate.js +++ b/src/generate.js @@ -41,10 +41,12 @@ const object = fields => { return result } -const array = (rule, {minLength, maxLength}) => { - const length = chance.integer({min: minLength, max: maxLengthx}) +const array = ({rule, minLength, maxLength}) => { + if (rule.type == 'ref') + return [] + const length = chance.integer({min: minLength, max: maxLength}) , items = [] - , i = 0 + let i = 0 while (i < length) { items.push(generate(rule)) i ++