Created
March 19, 2019 02:20
-
-
Save Qquanwei/da8fa7553d05a47a573809056789cb3a to your computer and use it in GitHub Desktop.
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
function imageMatch(file) { | |
return readImageAsPromise(file).then(image => { | |
return of(image).map(itShouldProp('width', large(10), always('image width should large 10, now is ' + image.width))) | |
}) | |
} | |
of({ filename: 'c:/fakepath/file.txt'}) | |
.map(itShould(imageMatch, always('image not exists'))) | |
.validate(( success, reason) => { | |
// async validation just fun | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment