Skip to content

Commit 0c0ba70

Browse files
committed
Date: Cleaning up the tests and adding a failing test for the months issue.
1 parent a8da325 commit 0c0ba70

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

tests/unit/date/date_core.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,17 @@ test('Days', 1, function(){
144144
ok(date.days(), 'Date days() returns');
145145
});
146146

147-
test('Months', 1, function(){
148-
var date = $.date();
149-
ok(date.months(1), 'Months returns')
150-
151-
var dateMonth1 = date.clone();
152-
dateMonth1.first = true;
153-
var dateMonth2 = date.clone().adjust('M',1);
154-
dateMonth2.last = true;
155-
//TODO compare objects
156-
//deepEqual(date.months(1), [ dateMonth1, dateMonth2 ], 'Months returned correctly');
147+
test( "Months", 5, function(){
148+
var date = $.date(),
149+
firstMonth = date.months( 1 )[ 0 ],
150+
lastMonth = date.months( 1 )[ 1 ];
151+
152+
ok( firstMonth.first );
153+
ok( !lastMonth.first );
154+
ok( lastMonth.last );
155+
ok( !lastMonth.first );
156+
157+
ok( firstMonth.month() == ( lastMonth.month() - 1 ) );
157158
});
158159

159160
test('iso8601Week', 2, function(){

0 commit comments

Comments
 (0)