Add t.assert() to type definitions
This commit is contained in:
parent
20db474961
commit
a7605dec23
2 changed files with 22 additions and 0 deletions
11
index.d.ts
vendored
11
index.d.ts
vendored
|
|
@ -29,6 +29,9 @@ export type SnapshotOptions = {
|
|||
};
|
||||
|
||||
export interface Assertions {
|
||||
/** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */
|
||||
assert: AssertAssertion;
|
||||
|
||||
/** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
|
||||
deepEqual: DeepEqualAssertion;
|
||||
|
||||
|
|
@ -96,6 +99,14 @@ export interface Assertions {
|
|||
truthy: TruthyAssertion;
|
||||
}
|
||||
|
||||
export interface AssertAssertion {
|
||||
/** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */
|
||||
(actual: any, message?: string): void;
|
||||
|
||||
/** Skip this assertion. */
|
||||
skip(actual: any, message?: string): void;
|
||||
}
|
||||
|
||||
export interface DeepEqualAssertion {
|
||||
/** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
|
||||
<ValueType = any>(actual: ValueType, expected: ValueType, message?: string): void;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ export type SnapshotOptions = {
|
|||
};
|
||||
|
||||
export interface Assertions {
|
||||
/** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */
|
||||
assert: AssertAssertion;
|
||||
|
||||
/** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
|
||||
deepEqual: DeepEqualAssertion;
|
||||
|
||||
|
|
@ -109,6 +112,14 @@ export interface Assertions {
|
|||
truthy: TruthyAssertion;
|
||||
}
|
||||
|
||||
export interface AssertAssertion {
|
||||
/** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */
|
||||
(actual: any, message?: string): void;
|
||||
|
||||
/** Skip this assertion. */
|
||||
skip(actual: any, message?: string): void;
|
||||
}
|
||||
|
||||
export interface DeepEqualAssertion {
|
||||
/** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
|
||||
(actual: any, expected: any, message?: string): void;
|
||||
|
|
|
|||
Loading…
Reference in a new issue