-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.js
34 lines (30 loc) · 940 Bytes
/
test.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
/*!
* is-extendable <https://github.com/jonschlinkert/is-extendable>
*
* Copyright (c) 2015-2017, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
require('mocha');
var assert = require('assert');
var isExtendable = require('./');
describe('isExtendable', function() {
it('should return true when a value is an object:', function() {
assert(isExtendable({}));
assert(isExtendable([]));
assert(isExtendable(function() {}));
});
it('should return false when a value is not an object:', function() {
assert(!isExtendable(new RegExp('foo')));
assert(!isExtendable(/foo/));
assert(!isExtendable(new Date()));
assert(!isExtendable(new Error()));
assert(!isExtendable('a'));
assert(!isExtendable(5));
assert(!isExtendable(null));
assert(!isExtendable());
assert(!isExtendable(undefined));
assert(!isExtendable(true));
assert(!isExtendable(false));
});
});