Skip to content

Commit

Permalink
Merge pull request #12 from bigpipe/doc-test-expectation
Browse files Browse the repository at this point in the history
[doc] `expectation` is expected to be a compiled template
  • Loading branch information
Martijn Swaagman committed Jan 6, 2016
2 parents c68861e + 8e99785 commit ce78b57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ _the_ most important method of all. It accepts the following arguments:

- `passed`, a boolean which indicates if the assertion failed or passed.
- `msg`, a string which is the reason or message provided by the users.
- `expectation`, a string which explains what the assertion expected.
- `expectation`, a compiled template which explains what the assertion expected.
- `slice`, a number which slices of stacks from the stack trace. This is keeps
the stack trace clear of all references to our own assertion library and only
contains the part of the test/suite where the assertion was initiated. This
Expand All @@ -773,7 +773,8 @@ If the `assertion` passes the method will return it self, or it will throw.

```js
assume.add('true', function (msg) {
return this.test(this.value === true, msg, 'value to @ be true');
var expectation = format('value to @ be true');
return this.test(this.value === true, msg, expectation);
});
```

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ Assert.add('clone', function clone(value) {
*
* @param {Boolean} passed Didn't the test pass or fail.
* @param {String} msg Custom message provided by users.
* @param {String} expectation What the assertion expected.
* @param {Function} expectation Compiled expectation template
* @param {Number} slice The amount of stack traces we need to remove.
* @returns {Assert}
* @api public
Expand Down

0 comments on commit ce78b57

Please sign in to comment.