Skip to content

Commit

Permalink
[ Support for declarations in (call, if, scatter & while) blocks ]
Browse files Browse the repository at this point in the history
* Coverage increased
  • Loading branch information
TimSPb89 committed Mar 12, 2018
1 parent a953956 commit cbb1d57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/model/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Group extends Step {
root.declarations[declaration.name] = declaration;
}
this.ownDeclarations[declaration.name] = declaration;
} else if ((existingInRoot && existingInRoot !== declaration) || ownExisting !== declaration) {
} else if (existingInRoot !== declaration && ownExisting !== declaration) {
throw new Error(`Cannot add a declaration with the same name ${declaration.name}.`);
}
return declaration;
Expand Down
5 changes: 4 additions & 1 deletion test/parser/parseTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ workflow RootWorkflow {
resolve(data);
}
});
}).then(data => parse(wdl, { zipFile: data, subWfDetailing: '*', recursionDepth: 10 }))).to.be.fulfilled);
}).then(data => parse(wdl, { zipFile: data, subWfDetailing: ['*'], recursionDepth: 10 }))).to.be.fulfilled);

it('returns with error if source zip is incorrect', () =>
expect(parse(wdl, { zipFile: 'test' })).to.be.rejectedWith('Error'));

it('returns with error if no wdl presented', () =>
expect(parse('')).to.be.rejected);
});

0 comments on commit cbb1d57

Please sign in to comment.