diff --git a/index.d.ts b/index.d.ts index fca580a4a..c78972fdf 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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`. */ (actual: ValueType, expected: ValueType, message?: string): void; diff --git a/index.js.flow b/index.js.flow index 2277fffba..cc31f065f 100644 --- a/index.js.flow +++ b/index.js.flow @@ -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;