This repository has been archived by the owner on May 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70abb36
commit 9849f29
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var assert = require('assert') | ||
var is = require('../lib/is') | ||
var fn = function(){} | ||
|
||
var future = new Date('04/16/9999') | ||
var today = new Date() | ||
var past = new Date('04/16/1982') | ||
|
||
describe('plainObject', function(){ | ||
|
||
it('works', function(){ | ||
assert.equal(false, is.plainObject(fn), 'fn is wrong') | ||
assert.equal(false, is.plainObject(new Date()), 'new Date() is wrong') | ||
assert.equal(false, is.plainObject(undefined), 'undefined is wrong') | ||
assert.equal(false, is.plainObject(NaN), 'NaN is wrong') | ||
assert.equal(false, is.plainObject(null), 'null is wrong') | ||
assert.equal(false, is.plainObject(true), 'true is wrong') | ||
assert.equal(false, is.plainObject(false), 'false is wrong') | ||
assert.equal(true , is.plainObject({}), '{} is wrong') | ||
assert.equal(false, is.plainObject([]), '[] is wrong') | ||
assert.equal(false, is.plainObject(""), '"" is wrong') | ||
assert.equal(false, is.plainObject(" "), '" " is wrong') | ||
assert.equal(false, is.plainObject("asdf"), '"asdf" is wrong') | ||
assert.equal(false, is.plainObject("1.23"), '"1.23" is wrong') | ||
assert.equal(false, is.plainObject("-42"), '"-42" is wrong') | ||
assert.equal(false, is.plainObject("-42.01"), '"-42.01" is wrong') | ||
assert.equal(false, is.plainObject("-1"), '"-1" is wrong') | ||
assert.equal(false, is.plainObject("0"), '"0" is wrong') | ||
assert.equal(false, is.plainObject("666"), '"666" is wrong') | ||
assert.equal(false, is.plainObject(1.23), '1.23 is wrong') | ||
assert.equal(false, is.plainObject(-42), '-42 is wrong') | ||
assert.equal(false, is.plainObject(-1), '-1 is wrong') | ||
assert.equal(false, is.plainObject(0), '0 is wrong') | ||
assert.equal(false, is.plainObject(666), '666 is wrong') | ||
}) | ||
|
||
}) |