Skip to content

Commit

Permalink
added test to accept if summary is nonexistent
Browse files Browse the repository at this point in the history
  • Loading branch information
dangoosby committed Mar 29, 2018
1 parent b132edc commit e8c7469
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ const lint = (objectName, object, options = {}) => {
if (rule.exists) {
const { value, property } = rule.exists;
if (object[property]) {
ensure(rule, () => {
object[property].should.not.exist(value);
})
ensure(rule, () => {
object[property].should.not.exist(value);
});
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions test/linter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ describe('linter.js', () => {

context('exists', () => {
const rule = {
"name": "exists",
"object": "*",
"enabled": true,
"exists": { "property": "summary", "value": null }
"name": "exists",
"object": "*",
"enabled": true,
"exists": { "property": "summary", "value": null }
};

it('accepts when value is nonexistent', done => {
const input = { summary: null };
lintAndExpectValid(rule, input);
done();
const input = { summary: null };
lintAndExpectValid(rule, input);
done();
})
});

Expand Down

0 comments on commit e8c7469

Please sign in to comment.