Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
🐛 Handle cypress failures when not valid URI component
Browse files Browse the repository at this point in the history
  • Loading branch information
willclarktech committed Nov 24, 2017
1 parent 8970778 commit fe4f8e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cypress/integration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ const throwFailuresInWindow = win => {

if (failures.length) {
const failuresHTML = Array.from(failures).map(el => el.outerHTML);
const errorString = failuresHTML.map(decodeURIComponent).join('\n');
let errorString;
try {
errorString = failuresHTML.map(decodeURIComponent).join('\n');
} catch (error) {
errorString = failuresHTML.join('\n');
}
throw new Error(errorString);
}
};
Expand Down

0 comments on commit fe4f8e1

Please sign in to comment.