-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
73 lines (69 loc) · 2.71 KB
/
index.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Type definitions for chai-arrays 1.0
// Project: https://github.com/GaneshSPatil/chai-arrays
// Definitions by: Clément Prévot <https://github.com/clementprevot>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="chai" />
declare global {
namespace Chai {
interface Assertion
extends LanguageChains,
NumericComparison,
TypeComparison {
emitEvent(eventName?: string, message?: string): Assertion;
emitEventAt(eventName: string, position: number, message?: string): Assertion;
emitEventWithArgs(
eventName: string,
assertArgsFn: (args: Truffle.TransactionLogArgs) => boolean,
message?: string,
): Assertion;
emitEventWithArgsAt(
eventName: string,
assertArgsFn: (args: Truffle.TransactionLogArgs) => boolean,
position: number,
message?: string,
): Assertion;
eventLength(expectedLength: number, message?: string): Assertion;
eventLengthOf(expectedLength: number, message?: string): Assertion;
evmFail(errorMessage?: string, message?: string): Assertion;
evmInvalidOpcode(message?: string): Assertion;
evmOutOfGas(message?: string): Assertion;
evmRevert(message?: string): Assertion;
evmSuccess(message?: string): Assertion;
transactionResponse: Assertion;
withEventArgs(
assertArgsFn: (args: Truffle.TransactionLogArgs, message?: string) => boolean,
): Assertion;
}
interface Assert {
emitEvent<T>(val: T, eventName?: string, message?: string): void;
emitEventAt<T>(val: T, eventName: string, position: number, message?: string): void;
emitEventWithArgs<T>(
val: T,
eventName: string,
assertArgsFn: (args: Truffle.TransactionLogArgs) => boolean,
message?: string,
): void;
emitEventWithArgsAt<T>(
val: T,
eventName: string,
assertArgsFn: (args: Truffle.TransactionLogArgs) => boolean,
position: number,
message?: string,
): void;
eventLength<T>(val: T, expectedLength: number, message?: string): void;
eventLengthOf<T>(val: T, expectedLength: number, message?: string): void;
evmFail<T>(val: T, errorMessage?: string, message?: string): void;
evmInvalidOpcode<T>(val: T, message?: string): void;
evmOutOfGas<T>(val: T, message?: string): void;
evmRevert<T>(val: T, message?: string): void;
evmSuccess<T>(val: T, message?: string): void;
withEventArgs<T>(
val: T,
assertArgsFn: (args: Truffle.TransactionLogArgs) => boolean,
message?: string,
): void;
}
}
}
declare function chaiTruffle(chai: any, utils: any): void;
export = chaiTruffle;