Skip to content

Commit

Permalink
[Tests] add Date and RegExp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 28, 2020
1 parent 4324cbb commit 3b28eca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,18 @@ test('Booleans', function (t) {

t.end();
});

test('Date', function (t) {
var now = new Date();
t.equal(inspect(now), String(now), 'Date shows properly');
t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly');

t.end();
});

test('RegExps', function (t) {
t.equal(inspect(/a/g), '/a/g', 'regex shows properly');
t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly');

t.end();
});

0 comments on commit 3b28eca

Please sign in to comment.