]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Update invalid date check in tests
authorIskren Chernev <iskren.chernev@gmail.com>
Sat, 12 Nov 2016 06:25:27 +0000 (22:25 -0800)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 12 Nov 2016 06:25:27 +0000 (22:25 -0800)
src/test/moment/create.js

index ba6ba4f9d769000ebafac2c7bb8d4c8206036993..ac744b38952ecdbfe71323e2c577418747b9ebaa 100644 (file)
@@ -1103,5 +1103,6 @@ test('parsing only meridiem results in invalid date', function (assert) {
 
 test('invalid dates return invalid for methods that access the _d prop', function (assert) {
     var momentAsDate = moment(['2015', '12', '1']).toDate();
-    assert.equal(momentAsDate, 'Invalid Date', 'toDate returns invalid');
+    assert.ok(momentAsDate instanceof Date, 'toDate returns a Date object');
+    assert.ok(isNaN(momentAsDate.getTime()), 'toDate returns an invalid Date invalid');
 });