Skip to content

Commit

Permalink
Fixed reference to type validator
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcourtice committed Apr 4, 2017
1 parent 2686042 commit 1b77eb7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions test/utilities/validators.js
Expand Up @@ -2,53 +2,53 @@ import {
assert
} from "chai";

import * as validators from "../../src/utilities/validators";
import * as typeValidator from "../../src/utilities/base/type-validator";

describe("Validators", () => {
describe("Type Validator", () => {

it("should validate the type of an array", () => {
let result = validators.isArray([]);
let result = typeValidator.isArray([]);

assert.isTrue(result);
});

it("should validate the type of a boolean", () => {
let result = validators.isBoolean(true);
let result = typeValidator.isBoolean(true);

assert.isTrue(result);
});

it("should validate the type of a date", () => {
let result = validators.isDate(new Date());
let result = typeValidator.isDate(new Date());

assert.isTrue(result);
});

it("should validate the type of null", () => {
let result = validators.isNull(null);
let result = typeValidator.isNull(null);

assert.isTrue(result);
});

it("should validate the type of a number", () => {
let result = validators.isNumber(5);
let result = typeValidator.isNumber(5);

assert.isTrue(result);
});

it("should validate the type of an object", () => {
let result = validators.isObject({});
let result = typeValidator.isObject({});

assert.isTrue(result);
});

it("should validate primitive types", () => {
let arrayResult = validators.isPrimitive([]);
let boolResult = validators.isPrimitive(true);
let dateResult = validators.isPrimitive(new Date());
let numberResult = validators.isPrimitive(5);
let objectResult = validators.isPrimitive({});
let stringResult = validators.isPrimitive("hello");
let arrayResult = typeValidator.isPrimitive([]);
let boolResult = typeValidator.isPrimitive(true);
let dateResult = typeValidator.isPrimitive(new Date());
let numberResult = typeValidator.isPrimitive(5);
let objectResult = typeValidator.isPrimitive({});
let stringResult = typeValidator.isPrimitive("hello");

assert.isFalse(arrayResult);
assert.isTrue(boolResult);
Expand Down

0 comments on commit 1b77eb7

Please sign in to comment.