Dedupe bad chai-datetime merge (#47828)

Two PRs arrived for the same thing: add closeToTime to chai-datetime.

The two PRs are #46803 and #46697
This commit is contained in:
Nathan Shively-Sanders 2020-09-21 08:31:57 -07:00 committed by GitHub
parent e5dc17cbbe
commit a349594bae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -13,13 +13,6 @@ function test_equalTime(){
assert.equalTime(date, date);
}
function test_closeToTime(){
const date: Date = new Date(2014, 1, 1);
const closeTime: Date = new Date(2014, 1, 1, 0, 0, 30);
expect(date).to.be.closeToTime(closeTime, 40);
expect(date).not.to.be.closeToTime(closeTime, 20);
}
function test_beforeTime(){
const date: Date = new Date(2014, 1, 1);
expect(date).to.be.beforeTime(date);
@ -34,7 +27,14 @@ function test_afterTime(){
assert.afterTime(date, date);
}
function test_closeToTime(){
function test_closeToTime1(){
const date: Date = new Date(2014, 1, 1);
const closeTime: Date = new Date(2014, 1, 1, 0, 0, 30);
expect(date).to.be.closeToTime(closeTime, 40);
expect(date).not.to.be.closeToTime(closeTime, 20);
}
function test_closeToTime2(){
const date: Date = new Date(2014, 1, 1, 6, 0);
const closeDate: Date = new Date(2014, 1, 1, 6, 1);
expect(date).to.be.closeToTime(closeDate, 120);

View File

@ -21,7 +21,6 @@ declare global {
afterTime(date: Date): Assertion;
beforeTime(date: Date): Assertion;
equalTime(date: Date): Assertion;
closeToTime(date: Date, delta: number): Assertion;
withinTime(dateFrom: Date, dateTo: Date): Assertion;
}