Commits

urso  committed 079c286

added function modifier "expectException"

  • Participants
  • Parent commits a57fd43

Comments (0)

Files changed (1)

     return { arb: gen, shrink: shrinkFn };
 }
 
+function expectException(fn) {
+    return function(c){
+        try {
+            fn.apply(arguments);
+        } catch (e) {
+            if(e === 'AssertFailed' || e === 'InvalidCase') {
+                throw e;
+            }
+            c.assert(true);
+            return;
+        }
+        c.assert(false);
+    }
+}
+