Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
fix empty path option array wouldnt write tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Dietz authored and Noah Dietz committed Aug 17, 2015
1 parent 1c3c39e commit 1736b57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ function testGen(swagger, config) {
var filename;
var schemaTemp;
var environment;
var ndx = 0;


source = read(join(__dirname, 'templates/schema.handlebars'), 'utf8');
Expand All @@ -429,7 +430,7 @@ function testGen(swagger, config) {
len = config.maxLen;
}

if (config.pathName.length === 0) {
if (!targets || targets.length === 0) {
// builds tests for all paths in API
_.forEach(paths, function(path, pathName) {
result.push(testGenPath(swagger, pathName, config));
Expand All @@ -442,7 +443,7 @@ function testGen(swagger, config) {
}

// no specified paths to build, so build all of them
if (config.pathName.length === 0) {
if (!targets || targets.length === 0) {
_.forEach(result, function(results) {
output.push({
name: '-test.js',
Expand Down Expand Up @@ -475,7 +476,7 @@ function testGen(swagger, config) {
}
output.push({
name: filename,
test: target
test: result[ndx++]
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/deprecated/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var read = require('fs').readFileSync;
rules = yaml.safeLoad(read(join(__dirname, '/../../.eslintrc'), 'utf8'));
rules.env = {mocha: true};

describe('security swagger', function() {
describe('deprecated swagger', function() {
describe('assert-option', function() {
describe('expect', function() {
var output1 = testGen(swagger, {
Expand Down

0 comments on commit 1736b57

Please sign in to comment.