Skip to content

Commit 53fb487

Browse files
malimccallanovemberborn
authored andcommitted
Add inline docs to Assertions interfaces
1 parent a510088 commit 53fb487

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

index.d.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,61 @@ export type SnapshotOptions = {
2626
};
2727

2828
export interface Assertions {
29+
/** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
2930
deepEqual: DeepEqualAssertion;
31+
32+
/** Fail the test. */
3033
fail: FailAssertion;
34+
35+
/** Assert that `actual` is strictly false. */
3136
false: FalseAssertion;
37+
38+
/** Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy). */
3239
falsy: FalsyAssertion;
40+
41+
/**
42+
* Assert that `actual` is [the same
43+
* value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
44+
*/
3345
is: IsAssertion;
46+
47+
/**
48+
* Assert that `actual` is not [the same
49+
* value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
50+
*/
3451
not: NotAssertion;
52+
53+
/** Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
3554
notDeepEqual: NotDeepEqualAssertion;
55+
56+
/** Assert that `string` does not match the regular expression. */
3657
notRegex: NotRegexAssertion;
58+
59+
/** Assert that the function does not throw. */
3760
notThrows: NotThrowsAssertion;
61+
62+
/** Count a passing assertion. */
3863
pass: PassAssertion;
64+
65+
/** Assert that `string` matches the regular expression. */
3966
regex: RegexAssertion;
67+
68+
/**
69+
* Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a
70+
* previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if
71+
* necessary record a new snapshot.
72+
*/
4073
snapshot: SnapshotAssertion;
74+
75+
/**
76+
* Assert that the function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error value.
77+
*/
4178
throws: ThrowsAssertion;
79+
80+
/** Assert that `actual` is strictly true. */
4281
true: TrueAssertion;
82+
83+
/** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). */
4384
truthy: TruthyAssertion;
4485
}
4586

index.js.flow

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,61 @@ export type SnapshotOptions = {
3131
};
3232

3333
export interface Assertions {
34+
/** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
3435
deepEqual: DeepEqualAssertion;
36+
37+
/** Fail the test. */
3538
fail: FailAssertion;
39+
40+
/** Assert that `actual` is strictly false. */
3641
false: FalseAssertion;
42+
43+
/** Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy). */
3744
falsy: FalsyAssertion;
45+
46+
/**
47+
* Assert that `actual` is [the same
48+
* value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
49+
*/
3850
is: IsAssertion;
51+
52+
/**
53+
* Assert that `actual` is not [the same
54+
* value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
55+
*/
3956
not: NotAssertion;
57+
58+
/** Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
4059
notDeepEqual: NotDeepEqualAssertion;
60+
61+
/** Assert that `string` does not match the regular expression. */
4162
notRegex: NotRegexAssertion;
63+
64+
/** Assert that the function does not throw. */
4265
notThrows: NotThrowsAssertion;
66+
67+
/** Count a passing assertion. */
4368
pass: PassAssertion;
69+
70+
/** Assert that `string` matches the regular expression. */
4471
regex: RegexAssertion;
72+
73+
/**
74+
* Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a
75+
* previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if
76+
* necessary record a new snapshot.
77+
*/
4578
snapshot: SnapshotAssertion;
79+
80+
/**
81+
* Assert that the function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error value.
82+
*/
4683
throws: ThrowsAssertion;
84+
85+
/** Assert that `actual` is strictly true. */
4786
true: TrueAssertion;
87+
88+
/** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). */
4889
truthy: TruthyAssertion;
4990
}
5091

0 commit comments

Comments
 (0)