mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
Merge pull request #2128 from daptiv/chai-datetime-definitions
Chai-datetime definitions
This commit is contained in:
47
chai-datetime/chai-datetime-tests.ts
Normal file
47
chai-datetime/chai-datetime-tests.ts
Normal file
@@ -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);
|
||||
}
|
||||
33
chai-datetime/chai-datetime.d.ts
vendored
Normal file
33
chai-datetime/chai-datetime.d.ts
vendored
Normal file
@@ -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;
|
||||
}
|
||||
32
chai/chai.d.ts
vendored
32
chai/chai.d.ts
vendored
@@ -9,28 +9,28 @@ declare module chai {
|
||||
function expect(target: any, message?: string): Expect;
|
||||
|
||||
// Provides a way to extend the internals of Chai
|
||||
function use(fn: (chai: any, utils: any) => void);
|
||||
function use(fn: (chai: any, utils: any) => void): any;
|
||||
|
||||
interface ExpectStatic {
|
||||
(target: any): Expect;
|
||||
}
|
||||
|
||||
interface Assertions {
|
||||
attr(name, value?);
|
||||
css(name, value?);
|
||||
data(name, value?);
|
||||
class(className);
|
||||
id(id);
|
||||
html(html);
|
||||
text(text);
|
||||
value(value);
|
||||
visible;
|
||||
hidden;
|
||||
selected;
|
||||
checked;
|
||||
disabled;
|
||||
empty;
|
||||
exist;
|
||||
attr(name: string, value?: string): any;
|
||||
css(name: string, value?: string): any;
|
||||
data(name: string, value?: string): any;
|
||||
class(className: string): any;
|
||||
id(id: string): any;
|
||||
html(html: string): any;
|
||||
text(text: string): any;
|
||||
value(value: string): any;
|
||||
visible: any;
|
||||
hidden: any;
|
||||
selected: any;
|
||||
checked: any;
|
||||
disabled: any;
|
||||
empty: any;
|
||||
exist: any;
|
||||
}
|
||||
|
||||
interface Expect extends LanguageChains, NumericComparison, TypeComparison, Assertions {
|
||||
|
||||
Reference in New Issue
Block a user