-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console error only print {}, without effect message. #41
Comments
Are you sure this is not coming from your app or custom cypress code ? This plugin does not use any .split on anything. I would need more details on this. Maybe the error object format would be a starting point. Don't forget the it might seem that the error is coming from this plugin as it will show up in the stack since we are intercepting (overriding) the original console.error function in the browser. |
This message should be a catched error from app, maybe like this code: var a = 1;
try {
a.split(",");
} catch (e) {
// cypress-terminal-report print error line in terminal, but show "cons:error ✘ {}"
// in browser console, I can get "TypeError: a.split is not a function
console.error(e);
}
a.split(","); // make cypress run failed when "uncaught:exception" return true |
looks like |
I tried to reproduce the issue you have with the same code but I couldnt. The issue is that for some reason on your code the error that is thrown is not instance of window.Error. Another possibility is that the error doesnt have the stack property but I doubt that. I have an idea for a possible fix, I will release next week in a patch so we can try if it resolves it for you. In the meantime:
|
Browser: Electron 80
Yes You create a react app to reproduce this issue: import React, { Component } from "react";
import { Button } from "antd";
import "antd/dist/antd.css";
class App extends Component {
makeTypeError = () => {
var a = 1;
try {
a.split(",");
} catch (e) {
console.error(e);
console.info(e instanceof window.Error);
}
a.split(",");
};
render() {
return (
<div>
<Button id="error" onClick={this.makeTypeError}>
Make Type Error
</Button>
</div>
);
}
}
export default App; test code: describe("foobar", () => {
it("foobar", () => {
cy.visit("http://localhost:3000/");
cy.get("#error").click();
});
}); Terminal:
|
Released in 2.0.0. |
support/index.js
The text was updated successfully, but these errors were encountered: