Code coverage report for .readme/includes/Type/TypeExample.js

Statements: 100% (43 / 43)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 100% (43 / 43)      Ignored: none     

All files » .readme/includes/Type/ » TypeExample.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66  1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1   1 1  
 
var Type = Divhide.Type;
 
var type = Type.of({});
expect(type).toBe("object");
 
var type = Type.of([]);
expect(type).toBe("array");
 
var type = Type.of(1);
expect(type).toBe("number");
 
var type = Type.of("name");
expect(type).toBe("string");
 
var type = Type.of(true);
expect(type).toBe("boolean");
 
var isArray = Type.isArray([]);
expect(isArray).toBe(true);
 
var isBoolean = Type.isBoolean(true);
expect(isBoolean).toBe(true);
 
var isFunction = Type.isFunction(function(){});
expect(isFunction).toBe(true);
 
var isString = Type.isString("");
expect(isString).toBe(true);
 
var isObject = Type.isObject({});
expect(isObject).toBe(true);
 
var isObject = Type.isObject(null);
expect(isObject).toBe(false);
 
var isRegExp = Type.isRegExp(/reg/);
expect(isRegExp).toBe(true);
 
var isNumber = Type.isNumber(1);
expect(isNumber).toBe(true);
 
var isNumber = Type.isNumber("1.1");
expect(isNumber).toBe(true);
 
var isDefined = Type.isDefined(null);
expect(isDefined).toBe(false);
 
var isDefined = Type.isDefined(undefined);
expect(isDefined).toBe(false);
 
var isEmpty = Type.isEmpty("");
expect(isEmpty).toBe(true);
 
var isEmpty = Type.isEmpty([]);
expect(isEmpty).toBe(true);
 
var isEmpty =  Type.isEmpty({});
expect(isEmpty).toBe(true);
 
var isEmpty =  Type.isEmpty(null);
expect(isEmpty).toBe(true);
 
var isString = Type.instanceOf("string", String);
expect(isString).toBe(true);