Created
February 11, 2015 19:07
-
-
Save pjagielski/3dfe435b5455839e156b to your computer and use it in GitHub Desktop.
Schema failing in phantomjs tests
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
(deftest file-validation | |
(s/defschema FileSchema | |
{:file (s/maybe (s/both js/File (s/pred (fn [f] (if f (< (.-size f) 1000000))) 'large-file)))}) | |
(s/defn validated-file | |
[file :- [FileSchema]] 1) | |
(s/with-fn-validation | |
(is (= 1 (validated-file {:file nil}))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment