Comments (6)
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.
from cypress-terminal-report.
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
from cypress-terminal-report.
looks like console.error(error)
will print {}
, use string is ok.
from cypress-terminal-report.
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:
- what browser do you use?
- do you have any polyfills that might change the error object?
- can you check in the catch whether error instanceof window.Error ?
from cypress-terminal-report.
- what browser do you use?
Browser: Electron 80
- can you check in the catch whether error instanceof window.Error ?
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:
cy:command ✔ visit http://localhost:3000/
cy:command ✔ get #error
cy:command ✘ click
cy:xhr ⓘ GET http://localhost:3000/sockjs-node/info?t=1598261034294
cons:error ✘ {}
from cypress-terminal-report.
Released in 2.0.0.
from cypress-terminal-report.
Related Issues (20)
- cy:xhr logs show "undefined" in Cypress 13 HOT 4
- Log spec code runtime errors HOT 5
- v5.3.5 error when running, 'import' and 'export' may only appear with sourceType: module HOT 2
- Commands from subsequent test retries are not logged to console HOT 1
- Integration with cypress-io/github-action@v6 HOT 2
- Vulnerability - semver - Regular Expression Denial of Service (ReDoS) HOT 2
- Doesn't work with Component tests HOT 3
- unconditional "debugger" statement is pausing execution for all tests that use LogCollectCypressFetch HOT 1
- How to filter `Verbose level` HOT 2
- Getting error in component testing HOT 3
- cy.api request as cy:request logs and not cy:command HOT 1
- Bug: Cypress Component testing on React logs console logs recursively HOT 1
- Integration with cypress-mochawesome-reporter HOT 1
- Does not seem to work with cypress-parallel-tests HOT 2
- Console errors are not retrieved during Hooks v6.0.0 HOT 2
- enableExtendedCollector prevents usage of Cypress on fail event HOT 2
- Is it possible to turn off the after each hook log? HOT 2
- enableExtendedCollector fails when commandTimings is also set to 'seconds' HOT 1
- printLogsToConsole: 'never' not respected by enableExtendedCollector: true when includeSuccessfulHookLogs is also true HOT 1
- logging to file doesn't include logs from all attempts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-terminal-report.