forked from TrueFiEng/Waffle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type declarations for chai matchers (TrueFiEng#67)
* Move matchers to its own folder * Add type declarations for new chai matchers * Rewrite example tests in typescript * Fix linter errors
- Loading branch information
1 parent
c0683a7
commit 98f8c5f
Showing
11 changed files
with
128 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* tslint:disable */ | ||
/// <reference types="chai" /> | ||
// I cannot get ethers types to work for some reason | ||
|
||
declare namespace Chai { | ||
interface Assertion extends LanguageChains, NumericComparison, TypeComparison { | ||
reverted: AsyncAssertion; | ||
revertedWith(reason: string): AsyncAssertion; | ||
emit(contract: any, eventName: string): EmitAssertion; | ||
properHex(length: number): void; | ||
properPrivateKey: void; | ||
properAddress: void; | ||
changeBalance(wallet: any, balance: any): AsyncAssertion; | ||
changeBalances(wallets: any[], balances: any[]): AsyncAssertion; | ||
} | ||
|
||
interface NumberComparer { | ||
(value: any, message?: string): Assertion; | ||
} | ||
|
||
interface AsyncAssertion extends Assertion, Promise<void> { | ||
} | ||
|
||
interface EmitAssertion extends AsyncAssertion { | ||
withArgs(...args: any[]): AsyncAssertion; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
test/example/fixtures-example.js → test/example/fixtures-example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters