mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Updating jasmine to version 2.5 (#11688)
* Updating jasmine to version 2.5 * Fixing 2 small errors in the update of jasmine * withMock now takes a "() => void" * fixed the withMock syntax error * number added as type to seed function
This commit is contained in:
committed by
Mohamed Hegazy
parent
3ced2ed66c
commit
a2c0d1ebc6
43
jasmine/jasmine.d.ts
vendored
43
jasmine/jasmine.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Jasmine 2.4.1
|
||||
// Type definitions for Jasmine 2.5
|
||||
// Project: http://jasmine.github.io/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>, David Pärsson <https://github.com/davidparsson/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -65,6 +65,7 @@ declare namespace jasmine {
|
||||
function addMatchers(matchers: CustomMatcherFactories): void;
|
||||
function stringMatching(str: string): Any;
|
||||
function stringMatching(str: RegExp): Any;
|
||||
function formatErrorMsg(domain: string, usage: string) : (msg: string) => string
|
||||
|
||||
interface Any {
|
||||
|
||||
@@ -115,6 +116,7 @@ declare namespace jasmine {
|
||||
/** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */
|
||||
tick(ms: number): void;
|
||||
mockDate(date?: Date): void;
|
||||
withMock(func: () => void): void;
|
||||
}
|
||||
|
||||
interface CustomEqualityTester {
|
||||
@@ -180,9 +182,12 @@ declare namespace jasmine {
|
||||
addMatchers(matchers: CustomMatcherFactories): void;
|
||||
specFilter(spec: Spec): boolean;
|
||||
throwOnExpectationFailure(value: boolean): void;
|
||||
seed: (s: number) => number;
|
||||
randomTests: () => boolean;
|
||||
randomizeTests: (b: boolean) => void;
|
||||
seed(seed: string | number): string | number;
|
||||
provideFallbackReporter(reporter: Reporter): void;
|
||||
throwingExpectationFailures(): boolean;
|
||||
allowRespy(allow: boolean): void;
|
||||
randomTests(): boolean;
|
||||
randomizeTests(b: boolean): void;
|
||||
}
|
||||
|
||||
interface FakeTimer {
|
||||
@@ -237,6 +242,26 @@ declare namespace jasmine {
|
||||
trace: Trace;
|
||||
}
|
||||
|
||||
interface Order {
|
||||
new (options: {random: boolean, seed: string}): any;
|
||||
random: boolean;
|
||||
seed: string;
|
||||
sort<T>(items: T[]) : T[];
|
||||
}
|
||||
|
||||
namespace errors {
|
||||
class ExpectationFailed extends Error {
|
||||
constructor();
|
||||
stack: any;
|
||||
}
|
||||
}
|
||||
|
||||
interface TreeProcessor {
|
||||
new (attrs: any): any;
|
||||
execute: (done: Function) => void;
|
||||
processTree() : any;
|
||||
}
|
||||
|
||||
interface Trace {
|
||||
name: string;
|
||||
message: string;
|
||||
@@ -304,7 +329,9 @@ declare namespace jasmine {
|
||||
toHaveBeenCalledTimes(expected: number): boolean;
|
||||
toContain(expected: any, expectationFailOutput?: any): boolean;
|
||||
toBeLessThan(expected: number, expectationFailOutput?: any): boolean;
|
||||
toBeLessThanOrEqual(expected: number, expectationFailOutput?: any): boolean;
|
||||
toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean;
|
||||
toBeGreaterThanOrEqual(expected: number, expectationFailOutput?: any): boolean;
|
||||
toBeCloseTo(expected: number, precision?: any, expectationFailOutput?: any): boolean;
|
||||
toThrow(expected?: any): boolean;
|
||||
toThrowError(message?: string | RegExp): boolean;
|
||||
@@ -374,6 +401,7 @@ declare namespace jasmine {
|
||||
runs(func: SpecFunction): Spec;
|
||||
addToQueue(block: Block): void;
|
||||
addMatcherResult(result: Result): void;
|
||||
getResult(): any;
|
||||
expect(actual: any): any;
|
||||
waits(timeout: number): Spec;
|
||||
waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec;
|
||||
@@ -383,11 +411,12 @@ declare namespace jasmine {
|
||||
finishCallback(): void;
|
||||
finish(onComplete?: () => void): void;
|
||||
after(doAfter: SpecFunction): void;
|
||||
execute(onComplete?: () => void): any;
|
||||
execute(onComplete?: () => void, enabled?: boolean): any;
|
||||
addBeforesAndAftersToQueue(): void;
|
||||
explodes(): void;
|
||||
spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy;
|
||||
removeAllSpies(): void;
|
||||
throwOnExpectationFailure: boolean;
|
||||
}
|
||||
|
||||
interface XSpec {
|
||||
@@ -487,6 +516,10 @@ declare namespace jasmine {
|
||||
finished: boolean;
|
||||
result: any;
|
||||
messages: any;
|
||||
runDetails: {
|
||||
failedExpectations: ExpectationResult[];
|
||||
order: jasmine.Order
|
||||
}
|
||||
|
||||
new (): any;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user