Permalink
Browse files

test: fix lint

  • Loading branch information...
1 parent 08b71e9 commit 3c073bb370dfc3e7078686049fd14de4696b127c @TooTallNate committed Nov 23, 2012
Showing with 22 additions and 21 deletions.
  1. +22 −21 test/date.js
View
@@ -8,33 +8,34 @@ describe('Date', function () {
it('should parse strings relative to TZ', function() {
var d = new time.Date('2012-1-12 02:00 PM', 'America/New_York')
- d.getTime().should.equal(1326394800000);
- d.getTimezone().should.equal('America/New_York');
+ d.getTime().should.equal(1326394800000)
+ d.getTimezone().should.equal('America/New_York')
d = new time.Date('2012-1-12 02:00 PM', 'America/Los_Angeles')
- d.getTime().should.equal(1326405600000);
- d.getTimezone().should.equal('America/Los_Angeles');
+ d.getTime().should.equal(1326405600000)
+ d.getTimezone().should.equal('America/Los_Angeles')
})
it('should interpret date parts relative to TZ', function() {
var d = new time.Date(2012, 0, 12, 14, 'America/New_York')
- d.getTime().should.equal(1326394800000);
- d.getTimezone().should.equal('America/New_York');
+ d.getTime().should.equal(1326394800000)
+ d.getFullYear().should.equal(2012)
+ d.getTimezone().should.equal('America/New_York')
- var d = new time.Date(2012, 0, 12, 14, 'America/Los_Angeles')
- d.getTime().should.equal(1326405600000);
- d.getTimezone().should.equal('America/Los_Angeles');
+ d = new time.Date(2012, 0, 12, 14, 'America/Los_Angeles')
+ d.getTime().should.equal(1326405600000)
+ d.getTimezone().should.equal('America/Los_Angeles')
})
it('should accept milliseconds regardless of TZ', function() {
- var d1 = new time.Date(1352005200000, 'America/New_York');
- var d2 = new time.Date(1352005200000, 'America/Los_Angeles');
+ var d1 = new time.Date(1352005200000, 'America/New_York')
+ var d2 = new time.Date(1352005200000, 'America/Los_Angeles')
- d1.getTime().should.equal(d2.getTime());
- d1.getTimezone().should.equal('America/New_York');
- d2.getTimezone().should.equal('America/Los_Angeles');
+ d1.getTime().should.equal(d2.getTime())
+ d1.getTimezone().should.equal('America/New_York')
+ d2.getTimezone().should.equal('America/Los_Angeles')
})
})
@@ -46,20 +47,20 @@ describe('Date', function () {
it('should clean up after itself', function () {
var initial = process.env.TZ
- , d = new time.Date
+ , d = new time.Date()
d.setTimezone('America/Argentina/San_Juan')
initial.should.equal(process.env.TZ)
})
it('should change the "timezone offset"', function () {
- var d = new time.Date
+ var d = new time.Date()
, offset = d.getTimezoneOffset()
d.setTimezone('US/Pacific')
d.getTimezoneOffset().should.not.equal(offset)
})
it('should match the UTC values when set to "UTC"', function () {
- var d = new time.Date
+ var d = new time.Date()
d.setTimezone('UTC')
d.getUTCDay().should.equal(d.getDay())
d.getUTCDate().should.equal(d.getDate())
@@ -73,7 +74,7 @@ describe('Date', function () {
})
it('should especially change the "hours" value', function () {
- var d = new time.Date
+ var d = new time.Date()
, hours = d.getHours()
d.setTimezone('US/Pacific')
@@ -92,13 +93,13 @@ describe('Date', function () {
describe('relative', function () {
it('should change the timezone', function () {
- var d = new time.Date
+ var d = new time.Date()
d.setTimezone('US/Pacific', true)
d.getTimezone().should.not.equal(process.env.TZ)
})
it('should keep local values', function () {
- var d = new time.Date
+ var d = new time.Date()
, millis = d.getMilliseconds()
, seconds = d.getSeconds()
, minutes = d.getMinutes()
@@ -119,7 +120,7 @@ describe('Date', function () {
})
it('should change the date\'s internal time value', function () {
- var d = new time.Date
+ var d = new time.Date()
, old = d.getTime()
d.setTimezone('US/Pacific', true)
d.getTime().should.not.equal(old)

0 comments on commit 3c073bb

Please sign in to comment.