-
-
Notifications
You must be signed in to change notification settings - Fork 305
/
deep.js
37 lines (32 loc) · 1.36 KB
/
deep.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
'use strict';
var test = require('../');
test('deep strict equal', function (t) {
t.notDeepEqual(
[{ a: '3' }],
[{ a: 3 }]
);
t.end();
});
test('deep loose equal', function (t) {
t.deepLooseEqual(
[{ a: '3' }],
[{ a: 3 }]
);
t.end();
});
test('requires 2 arguments', function (t) {
var err = /^TypeError: two arguments must be provided/;
t.throws(function () { t.deepEqual(); }, err, 'deepEqual: no args');
t.throws(function () { t.deepEqual(undefined); }, err, 'deepEqual: one arg');
t.throws(function () { t.deepLooseEqual(); }, err, 'deepLooseEqual: no args');
t.throws(function () { t.deepLooseEqual(undefined); }, err, 'deepLooseEqual: one arg');
t.throws(function () { t.notDeepEqual(); }, err, 'notDeepEqual: no args');
t.throws(function () { t.notDeepEqual(undefined); }, err, 'notDeepEqual: one arg');
t.throws(function () { t.notDeepLooseEqual(); }, err, 'notDeepLooseEqual: no args');
t.throws(function () { t.notDeepLooseEqual(undefined); }, err, 'notDeepLooseEqual: one arg');
t.throws(function () { t.equal(); }, err, 'equal: no args');
t.throws(function () { t.equal(undefined); }, err, 'equal: one arg');
t.throws(function () { t.notEqual(); }, err, 'notEqual: no args');
t.throws(function () { t.notEqual(undefined); }, err, 'notEqual: one arg');
t.end();
});