Skip to content

Commit

Permalink
remove skipPhantom args
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavnikolaj committed Jun 4, 2015
1 parent 6909a9f commit 6abbdb7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 45 deletions.
4 changes: 2 additions & 2 deletions documentation/assertions/function/to-error.md
Expand Up @@ -41,7 +41,7 @@ string as the second parameter.
expect(willBeRejected, 'to error', 'The reject message');
```

```javascript#skipPhantom:true
```javascript
expect(willBeRejected, 'to error', 'The error message');
```

Expand All @@ -68,7 +68,7 @@ expect(willBeRejected, 'to error', /reject message/);

In case of a failing expectation you get the following output:

```javascript#skipPhantom:true
```javascript
expect(willBeRejected, 'to error', /error message/);
```

Expand Down
82 changes: 39 additions & 43 deletions test/documentation.spec.js
Expand Up @@ -1883,53 +1883,49 @@ describe("documentation tests", function () {

expect(willBeRejected, 'to error', 'The reject message');

if (!isPhantom) {
try {
expect(willBeRejected, 'to error', 'The error message');
expect.fail(function (output) {
output.error("expected:").nl();
output.code("expect(willBeRejected, 'to error', 'The error message');").nl();
output.error("to throw");
});
} catch (e) {
expect(e, "to have message",
"expected\n" +
"function willBeRejected() {\n" +
" return expect.promise(function (resolve, reject) {\n" +
" reject(new Error('The reject message'));\n" +
" });\n" +
"}\n" +
"to error 'The error message'\n" +
" expected Error('The reject message') to satisfy 'The error message'\n" +
"\n" +
" -The reject message\n" +
" +The error message"
);
}
try {
expect(willBeRejected, 'to error', 'The error message');
expect.fail(function (output) {
output.error("expected:").nl();
output.code("expect(willBeRejected, 'to error', 'The error message');").nl();
output.error("to throw");
});
} catch (e) {
expect(e, "to have message",
"expected\n" +
"function willBeRejected() {\n" +
" return expect.promise(function (resolve, reject) {\n" +
" reject(new Error('The reject message'));\n" +
" });\n" +
"}\n" +
"to error 'The error message'\n" +
" expected Error('The reject message') to satisfy 'The error message'\n" +
"\n" +
" -The reject message\n" +
" +The error message"
);
}

expect(willBeRejected, 'to error', /reject message/);

if (!isPhantom) {
try {
expect(willBeRejected, 'to error', /error message/);
expect.fail(function (output) {
output.error("expected:").nl();
output.code("expect(willBeRejected, 'to error', /error message/);").nl();
output.error("to throw");
});
} catch (e) {
expect(e, "to have message",
"expected\n" +
"function willBeRejected() {\n" +
" return expect.promise(function (resolve, reject) {\n" +
" reject(new Error('The reject message'));\n" +
" });\n" +
"}\n" +
"to error /error message/\n" +
" expected Error('The reject message') to satisfy /error message/"
);
}
try {
expect(willBeRejected, 'to error', /error message/);
expect.fail(function (output) {
output.error("expected:").nl();
output.code("expect(willBeRejected, 'to error', /error message/);").nl();
output.error("to throw");
});
} catch (e) {
expect(e, "to have message",
"expected\n" +
"function willBeRejected() {\n" +
" return expect.promise(function (resolve, reject) {\n" +
" reject(new Error('The reject message'));\n" +
" });\n" +
"}\n" +
"to error /error message/\n" +
" expected Error('The reject message') to satisfy /error message/"
);
}

expect(willNotBeRejected, 'not to error');
Expand Down

0 comments on commit 6abbdb7

Please sign in to comment.