File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -3667,19 +3667,24 @@ getJasmineRequireObj().Expectation = function(j$) {
3667
3667
}
3668
3668
3669
3669
/**
3670
- * Add some context for an {@link expect}
3670
+ * Add some context to be included in matcher failures for an
3671
+ * {@link expect|expectation}, so that it can be more easily distinguished
3672
+ * from similar expectations.
3671
3673
* @function
3672
3674
* @name matchers#withContext
3673
3675
* @since 3.3.0
3674
3676
* @param {String } message - Additional context to show when the matcher fails
3675
3677
* @return {matchers }
3678
+ * @example
3679
+ * expect(things[0]).withContext('thing 0').toEqual('a');
3680
+ * expect(things[1]).withContext('thing 1').toEqual('b');
3676
3681
*/
3677
3682
Expectation . prototype . withContext = function withContext ( message ) {
3678
3683
return addFilter ( this , new ContextAddingFilter ( message ) ) ;
3679
3684
} ;
3680
3685
3681
3686
/**
3682
- * Invert the matcher following this {@link expect}
3687
+ * Invert the matcher following this {@link expect|expectation }
3683
3688
* @member
3684
3689
* @name matchers#not
3685
3690
* @since 1.3.0
Original file line number Diff line number Diff line change @@ -16,19 +16,24 @@ getJasmineRequireObj().Expectation = function(j$) {
16
16
}
17
17
18
18
/**
19
- * Add some context for an {@link expect}
19
+ * Add some context to be included in matcher failures for an
20
+ * {@link expect|expectation}, so that it can be more easily distinguished
21
+ * from similar expectations.
20
22
* @function
21
23
* @name matchers#withContext
22
24
* @since 3.3.0
23
25
* @param {String } message - Additional context to show when the matcher fails
24
26
* @return {matchers }
27
+ * @example
28
+ * expect(things[0]).withContext('thing 0').toEqual('a');
29
+ * expect(things[1]).withContext('thing 1').toEqual('b');
25
30
*/
26
31
Expectation . prototype . withContext = function withContext ( message ) {
27
32
return addFilter ( this , new ContextAddingFilter ( message ) ) ;
28
33
} ;
29
34
30
35
/**
31
- * Invert the matcher following this {@link expect}
36
+ * Invert the matcher following this {@link expect|expectation }
32
37
* @member
33
38
* @name matchers#not
34
39
* @since 1.3.0
You can’t perform that action at this time.
0 commit comments