Skip to content

Commit

Permalink
Added a check to error formatter. Bump version (v1.9.1-rc.1). Bump ha…
Browse files Browse the repository at this point in the history
…mmerhead (v17.1.13) (#5409)
  • Loading branch information
Ogurecher authored Aug 11, 2020
1 parent 05fde1b commit 9e854f1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .publishrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"gitTag": true
},
"confirm": true,
"publishTag": "latest",
"publishTag": "rc",
"prePublishScript": "gulp test-server",
"postPublishScript": "gulp docker-publish"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "testcafe",
"description": "Automated browser testing for the modern web development stack.",
"license": "MIT",
"version": "1.9.0",
"version": "1.9.1-rc.1",
"author": {
"name": "Developer Express Inc.",
"url": "https://www.devexpress.com/"
Expand Down Expand Up @@ -118,7 +118,7 @@
"source-map-support": "^0.5.16",
"strip-bom": "^2.0.0",
"testcafe-browser-tools": "2.0.13",
"testcafe-hammerhead": "17.1.12",
"testcafe-hammerhead": "17.1.13",
"testcafe-legacy-api": "4.0.0",
"testcafe-reporter-json": "^2.1.0",
"testcafe-reporter-list": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/errors/test-run/formattable-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class TestRunErrorFormattableAdapter {
if (node.nodeName !== '#document-fragment') {
const selector = TestRunErrorFormattableAdapter._getSelector(node);

msg = decorator[selector](msg, node.attrs);
msg = decorator[selector] ? decorator[selector](msg, node.attrs) : msg;
}
}

Expand Down
9 changes: 9 additions & 0 deletions test/server/test-run-error-formatting-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ describe('Error formatting', () => {
});
});

it('Should not throw if the specified decorator was not found', () => {
expect(() => {
const error = new ExternalAssertionLibraryError(testAssertionErrorArray, testCallsite);

error.diff = '<div class="unknown-decorator">text</div>';

getErrorAdapter(error).formatMessage('', 100);
}).to.not.throw();
});

it('Should format "actionIntegerOptionError" message', () => {
assertErrorMessage('action-integer-option-error', new ActionIntegerOptionError('offsetX', '1.01'));
Expand Down

0 comments on commit 9e854f1

Please sign in to comment.