6 var assert = require('assert');
9 'assert.eql()': function(){
10 assert.equal(assert.deepEqual, assert.eql);
13 'assert.type()': function(){
14 assert.type('foobar', 'string');
15 assert.type(2, 'number');
16 assert.throws(function(){
17 assert.type([1,2,3], 'string');
21 'assert.includes()': function(){
22 assert.includes('some random string', 'dom');
23 assert.throws(function(){
24 assert.include('some random string', 'foobar');
27 assert.includes(['foo', 'bar'], 'bar');
28 assert.includes(['foo', 'bar'], 'foo');
29 assert.includes([1,2,3], 3);
30 assert.includes([1,2,3], 2);
31 assert.includes([1,2,3], 1);
32 assert.throws(function(){
33 assert.includes(['foo', 'bar'], 'baz');
36 assert.throws(function(){
37 assert.includes({ wrong: 'type' }, 'foo');
41 'assert.isNull()': function(){
43 assert.throws(function(){
44 assert.isNull(undefined);
46 assert.throws(function(){
51 'assert.isUndefined()': function(){
52 assert.isUndefined(undefined);
53 assert.throws(function(){
54 assert.isUndefined(null);
56 assert.throws(function(){
57 assert.isUndefined(false);
61 'assert.isNotNull()': function(){
62 assert.isNotNull(false);
63 assert.isNotNull(undefined);
64 assert.throws(function(){
65 assert.isNotNull(null);
69 'assert.isDefined()': function(){
70 assert.isDefined(false);
71 assert.isDefined(null);
72 assert.throws(function(){
73 assert.isDefined(undefined);
77 'assert.match()': function(){
78 assert.match('foobar', /foo(bar)?/);
79 assert.throws(function(){
80 assert.match('something', /rawr/);
84 'assert.length()': function(){
85 assert.length('test', 4);
86 assert.length([1,2,3,4], 4);
87 assert.throws(function(){
88 assert.length([1,2,3], 4);