-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(predicates): Predicates help to ensure strong domain models that…
… can guarantee their correctnes
- Loading branch information
Showing
48 changed files
with
1,246 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'mocha'; | ||
import { given } from 'mocha-testdata'; | ||
|
||
import { check, hasLengthOf, isArray, isDefined, isGreaterThan, isInteger, TinyType } from '../src'; | ||
import { expect } from './expect'; | ||
|
||
/** @test {check} */ | ||
describe('::check', () => { | ||
|
||
it(`advises the developer if they've forgotten to specify the checks`, () => { | ||
const value = 2; | ||
expect(() => check('SomeProperty', value)) | ||
.to.throw(`Looks like you haven't specified any predicates to check the value of SomeProperty against?`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.