Skip to content

Commit

Permalink
Documentation: Fix promise terminology and some typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Jun 25, 2015
1 parent 23654c5 commit 6f44da8
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions documentation/api/UnexpectedError.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
When assertions fails in Unexpected they yield an
When assertions fail in Unexpected they yield an
`UnexpectedError`. This instance has several convenience methods for
retrieving information about the error.

Expand Down Expand Up @@ -72,9 +72,9 @@ expected 'bar' to equal 'bAr'
### UnexpectedError.parent

When assertions delegate to nested `expect` calls the errors that are
thrown on each level are chained together through the `parent`
thrown at each level are chained together through the `parent`
property. The error message is serialized lazily, so it is possible to
change the error hierarchy before the error is serialized or extract
change the error hierarchy before the error is serialized, or extract
information from the hierarchy and use [expect.fail](../fail/) to throw
a new error.

Expand Down Expand Up @@ -113,13 +113,13 @@ Return an array with all the ancestor errors to this error. See

### UnexpectedError.getAllErrors()

Return an array with this error and all it's ancestors. See
Return an array with this error and all its ancestors. See
<a href="#unexpectederror-parent">parent</a> for more information.

### UnexpectedError.getDiff()

Finds the first error in the hierarchy that contains a diff and
returns it. This method if useful if you want to hoist a diff from an
Find the first error in the hierarchy that contains a diff and
return it. This method if useful if you want to hoist a diff from an
ancestor error and combine it with a new message.

### UnexpectedError.getDiffMethod()
Expand Down Expand Up @@ -161,6 +161,6 @@ expected { custom: false } to be completely custom
### UnexpectedError.getLabel()

Get a shortened representation of the error message that doesn't
repeat the subject, for example should equal 'bar' rather than
expected 'foo' to equal 'bar'. This makes it suitable for display next
repeat the subject, for example `should equal 'bar'` rather than
`expected 'foo' to equal 'bar'`. This makes it suitable for display next
to an existing rendering of the subject, such as inside a diff.
16 changes: 8 additions & 8 deletions documentation/api/promise-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ title: promise.all

### expect.promise.all(...)

This method will find all promises in the given structure and return a
promise that resolves when all of the promises in the structure have
resolved. If any of the promises are rejected the resulting promise
will be rejected with the same error.
This method will find all promises in the given structure and return a promise
that will be fulfilled when all of the promises in the structure have been
fulfilled. If any of the promises is rejected, the resulting promise will be
rejected with the same error.

This method is usually used in combination with
[expect.promise.settle](/api/promise-settle).

Let's make an asynchronous assertion that we can uses for the examples:
Let's make an asynchronous assertion that we can use for the examples:

```js
expect.addAssertion('to be a number after a short delay', function (expect, subject) {
Expand All @@ -27,8 +27,8 @@ expect.addAssertion('to be a number after a short delay', function (expect, subj
See the [promise](/api/promise) documentation for more details on how
expect.promise works.

The following code snippet creates a promise that resolves when all the
promises in the nested structure resolves.
The following code snippet creates a promise that is fulfilled when all the
promises in the nested structure are fulfilled.

```js#async:true
return expect.promise.all({
Expand All @@ -43,7 +43,7 @@ return expect.promise.all({
});
```

The following code snippet create a promise that is rejected when one
The following code snippet creates a promise that is rejected when one
of the promises in the nested structure is rejected.

```js#async:true
Expand Down
18 changes: 9 additions & 9 deletions documentation/api/promise-any.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ title: promise.any

### expect.promise.any(...)

This method will find all promises in the given structure and return a
promise that resolves when any of the promises in the structure have
resolved. If all of the promises are rejected, the resulting promise
will be rejected with the errors.
This method will find all promises in the given structure and return a promise
that will be fulfilled when any of the promises in the structure have been
fulfilled. If all of the promises are rejected, the resulting promise will be
rejected with the errors.

Let's make an asynchronous assertion that we can uses for the examples:
Let's make an asynchronous assertion that we can use for the examples:

```js
expect.addAssertion('to be a number after a short delay', function (expect, subject) {
Expand All @@ -24,8 +24,8 @@ expect.addAssertion('to be a number after a short delay', function (expect, subj
See the [promise](/api/promise) documentation for more details on how
expect.promise works.

The following code snippet creates a promise that resolves when any the
promises in the nested structure resolves.
The following code snippet creates a promise that will be fulfilled when any
of the promises in the nested structure has been fulfilled.

```js#async:true
return expect.promise.any({
Expand All @@ -40,8 +40,8 @@ return expect.promise.any({
});
```

The following code snippet create a promise that is rejected when all
of the promises in the nested structure are rejected.
The following code snippet create a promise that will rejected when all
of the promises in the nested structure have been rejected:

```js#async:true
return expect.promise.any({
Expand Down
8 changes: 4 additions & 4 deletions documentation/api/promise-settle.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ title: promise.settle
### expect.promise.settle(...)

This method will find all promises in the given structure and return a
promise that resolves when all of the promises has been rejected or
resolved. When the returned promise resolves you can use
[synchronious inspection](https://github.com/petkaantonov/bluebird/blob/master/API.md#synchronous-inspection)
promise that will be fulfilled when all of the promises have been rejected or
fulfilled. When the returned promise is fulfilled, you can use
[synchronous inspection](https://github.com/petkaantonov/bluebird/blob/master/API.md#synchronous-inspection)
on each of the promises to read their values.

Let's make an asynchronous assertion that we can uses for the examples:
Let's make an asynchronous assertion that we can use for the examples:

```js
expect.addAssertion('to be a number after a short delay', function (expect, subject) {
Expand Down
2 changes: 1 addition & 1 deletion documentation/api/promise.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ promise will be rejected with the error.
Notice you can call the run wrapper as many times as you want as long
as it is within the current tick, the promise will wait for all the
wrapper functions to finish before the promise will be rejected or
resolved.
fulfilled.

When the promise body takes two arguments, it is just an alias for:

Expand Down
6 changes: 3 additions & 3 deletions documentation/assertions/Promise/to-be-rejected.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ var promiseThatWillBeRejected = expect.promise(function (resolve, reject) {
return expect(promiseThatWillBeRejected, 'to be rejected');
```

If the promise is resolved, the assertion will fail with the following output:
If the promise is fulfilled, the assertion will fail with the following output:

```javascript#async:true
var resolvedPromise = expect.promise(function (resolve, reject) {
var fulfilledPromise = expect.promise(function (resolve, reject) {
setTimeout(resolve, 1);
});
return expect(resolvedPromise, 'to be rejected');
return expect(fulfilledPromise, 'to be rejected');
```

```output
Expand Down

0 comments on commit 6f44da8

Please sign in to comment.