-
Notifications
You must be signed in to change notification settings - Fork 0
/
matcher-types.d.ts
30 lines (26 loc) · 1.27 KB
/
matcher-types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
type ImageVisual = HTMLCanvasElement | CanvasRenderingContext2D | HTMLImageElement | string;
declare namespace jasmine {
interface AsyncMatchers<T, U> {
toEqualImage(expected: ImageVisual, tolerance?: number, expectationFailOutput?: any): PromiseLike<void>;
}
interface Matchers<T> {
/**
* Compares ImageData to see what percentage of the pixels match
* @param expected ImageData that is expected
* @param tolerance [0..1] The tolerance of the compare, 1 means each pixel must match 100%, .5 means each pixel must match 50%, and so on. By default tolerance is set to .995, or 99.5% match
* @param expectationFailOutput
*/
toEqualImage(expected: ImageData, tolerance?: number, expectationFailOutput?: any): boolean;
/**
* Compares an Excalibur vector to another.
* @param expected Vector that is expect
* @param delta Distance that the 2 vectors can diverge, defaults to .01
*/
toBeVector(expected: ex.Vector, delta?: number): boolean;
/**
* Compares an Excalibur actor to a set of possible properties on actor
* @param expected The expected properties on an actor
*/
toHaveValues(expected: ex.ActorArgs): boolean;
}
}