Skip to content

Commit

Permalink
test: Date and RegExp
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Jun 16, 2017
1 parent e80419b commit d56f82a
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -57,3 +57,4 @@ typings/
# dotenv environment variables file
.env

.DS_Store
64 changes: 64 additions & 0 deletions spec/tests.js
Expand Up @@ -197,5 +197,69 @@ module.exports = [
equal: false
}
]
},
{
description: 'Date objects',
tests: [
{
description: 'equal date objects',
value1: new Date('2017-06-16T21:36:48.362Z'),
value2: new Date('2017-06-16T21:36:48.362Z'),
equal: true
},
{
description: 'not equal date objects',
value1: new Date('2017-06-16T21:36:48.362Z'),
value2: new Date('2017-01-01T00:00:00.000Z'),
equal: false
},
{
description: 'date and string are not equal',
value1: new Date('2017-06-16T21:36:48.362Z'),
value2: '2017-06-16T21:36:48.362Z',
equal: false
},
{
description: 'date and object are not equal',
value1: new Date('2017-06-16T21:36:48.362Z'),
value2: {},
equal: false
}
]
},
{
description: 'RegExp objects',
tests: [
{
description: 'equal RegExp objects',
value1: /foo/,
value2: /foo/,
equal: true
},
{
description: 'not equal RegExp objects (different pattern)',
value1: /foo/,
value2: /bar/,
equal: false
},
{
description: 'not equal RegExp objects (different flags)',
value1: /foo/,
value2: /foo/i,
equal: false
},
{
description: 'RegExp and string are not equal',
value1: /foo/,
value2: 'foo',
equal: false
},
{
description: 'RegExp and object are not equal',
value1: /foo/,
value2: {},
equal: false
}
]
}
];

0 comments on commit d56f82a

Please sign in to comment.