Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests for ‘exclusiveMaximum’

  • Loading branch information...
commit 27826556dcd71ecda74ce7773e88becf2ced9bee 1 parent 8d41e7d
@Baggz Baggz authored
Showing with 46 additions and 0 deletions.
  1. +46 −0 tests/validators/exclusiveMaximum.js
View
46 tests/validators/exclusiveMaximum.js
@@ -0,0 +1,46 @@
+// Load dependencies
+var amanda = require('../../src/amanda.js');
+
+/**
+ * Test #1
+ */
+exports['Test #1'] = function(test) {
+
+ var count = 0;
+
+ var schema = {
+ required: true,
+ type: 'number',
+ maximum: 10,
+ exclusiveMaximum: true
+ };
+
+ [
+ 11,
+ 100,
+ {},
+ null,
+ [],
+ function() {},
+ 'Hello!'
+ ].forEach(function(input) {
+ amanda.validate(input, schema, function(error) {
+ count += 1;
+ test.ok(error);
+ });
+ });
+
+ amanda.validate(10, schema, function(error) {
+ count += 1;
+ test.equal(error, undefined);
+ });
+
+ amanda.validate(2, schema, function(error) {
+ count += 1;
+ test.equal(error, undefined);
+ });
+
+ test.equal(count, 9);
+ test.done();
+
+};
Please sign in to comment.
Something went wrong with that request. Please try again.