Skip to content

Commit

Permalink
cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrussellLA committed Dec 1, 2018
1 parent 06e6189 commit 9febce7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/tz-offset-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'
let tzOffset = require("../src/tz-offset");
let { assert } = require("chai");
const tzOffset = require("../src/tz-offset");
const { assert } = require("chai");

process.env.TZ = "America/Sao_Paulo";

Expand All @@ -24,15 +24,15 @@ describe("tz-offset", () => {
});

it("should remove current offset", () => {
let date = new Date();
let utcTime = tzOffset.removeOffset(date);
const date = new Date();
const utcTime = tzOffset.removeOffset(date);
assert.equal(utcTime, date.getTime() + date.getTimezoneOffset() * 60000);
});

it("should return the time at zone", () => {
let date = new Date(2018, 8, 20, 0, 0, 0, 0);
let expectedDate = new Date(2018, 8, 20, 3, 0, 0, 0);
let result = tzOffset.timeAt(date, "Etc/UTC");
const date = new Date(2018, 8, 20, 0, 0, 0, 0);
const expectedDate = new Date(2018, 8, 20, 3, 0, 0, 0);
const result = tzOffset.timeAt(date, "Etc/UTC");
assert.equal(result.toString(), expectedDate.toString());
});
});

0 comments on commit 9febce7

Please sign in to comment.