Skip to content

Instantly share code, notes, and snippets.

@pjagielski
Created February 11, 2015 19:07
Show Gist options
  • Save pjagielski/3dfe435b5455839e156b to your computer and use it in GitHub Desktop.
Save pjagielski/3dfe435b5455839e156b to your computer and use it in GitHub Desktop.
Schema failing in phantomjs tests
(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