Skip to content

Commit e6560f7

Browse files
author
Cache Hamm
committed
Allow fact values to be undefined
1 parent 7da9dcc commit e6560f7

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/fact.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class Fact {
2626
}
2727

2828
if (!this.id) throw new Error('factId required')
29-
if (typeof this.value === 'undefined' && typeof this.calculationMethod === 'undefined') {
30-
throw new Error('facts must have a value or method')
31-
}
29+
// if (typeof this.value === 'undefined' && typeof this.calculationMethod === 'undefined') {
30+
// throw new Error('facts must have a value or method')
31+
// }
3232

3333
this.priority = parseInt(options.priority || 1, 10)
3434
this.options = Object.assign({}, defaultOptions, options)

test/fact.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ describe('Fact', () => {
2929
it('throws if no id provided', () => {
3030
expect(subject).to.throw(/factId required/)
3131
})
32-
33-
it('throws if no definition provided', () => {
34-
expect(subject.bind(null, 'factId')).to.throw(/facts must have a value or method/)
35-
})
3632
})
3733
})
3834

0 commit comments

Comments
 (0)