mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-12 12:10:44 +08:00
Added definitions for chai-datetime
- Added explicit "any" types to chai definitions
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
/// <reference path="../chai/chai-assert.d.ts" />
|
||||
/// <reference path="chai-datetime.d.ts" />
|
||||
|
||||
var expect = chai.expect;
|
||||
|
||||
function test_equalTime(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.be.equalTime(date);
|
||||
date.should.be.equalTime(date);
|
||||
assert.equalTime(date, date);
|
||||
}
|
||||
|
||||
function test_beforeTime(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.be.beforeTime(date);
|
||||
date.should.be.beforeTime(date);
|
||||
assert.beforeTime(date, date);
|
||||
}
|
||||
|
||||
function test_afterTime(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.be.afterTime(date);
|
||||
date.should.be.afterTime(date);
|
||||
assert.afterTime(date, date);
|
||||
}
|
||||
|
||||
function test_equalDate(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.equalDate(date);
|
||||
date.should.equalDate(date);
|
||||
assert.equalDate(date, date);
|
||||
}
|
||||
|
||||
function test_beforeDate(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.beforeDate(date);
|
||||
date.should.beforeDate(date);
|
||||
assert.beforeDate(date, date);
|
||||
}
|
||||
|
||||
function test_afterDate(){
|
||||
var date: Date = new Date(2014, 1, 1);
|
||||
expect(date).to.afterDate(date);
|
||||
date.should.afterDate(date);
|
||||
assert.afterDate(date, date);
|
||||
}
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// Type definitions for chai-datetime
|
||||
// Project: https://github.com/gaslight/chai-datetime.git
|
||||
// Definitions by: Cliff Burger <https://github.com/cliffburger/>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
|
||||
declare module chai {
|
||||
|
||||
interface Expect {
|
||||
afterDate(date: Date): boolean;
|
||||
beforeDate(date: Date): boolean;
|
||||
equalDate(date: Date): boolean;
|
||||
|
||||
afterTime(date: Date): boolean;
|
||||
beforeTime(date: Date): boolean;
|
||||
equalTime(date: Date): boolean;
|
||||
}
|
||||
|
||||
interface Assert {
|
||||
afterDate(leftDate: Date, rightDate: Date): boolean;
|
||||
beforeDate(leftDate: Date, rightDate: Date): boolean;
|
||||
equalDate(leftDate: Date, rightDate: Date): boolean;
|
||||
|
||||
afterTime(leftDate: Date, rightDate: Date): boolean;
|
||||
beforeTime(leftDate: Date, rightDate: Date): boolean;
|
||||
equalTime(leftDate: Date, rightDate: Date): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
interface Date {
|
||||
should: chai.Expect;
|
||||
}
|
||||
Reference in New Issue
Block a user