mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-13 02:30:09 -06:00
fix: Remove truncation of preprocessor errors (#15198)
This commit is contained in:
@@ -34,6 +34,8 @@ Looked for and couldn't find the file at the following paths:
|
||||
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.ts]
|
||||
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.tsx]
|
||||
@ ./cypress/support/index.js 3:0-27
|
||||
|
||||
[stack trace lines]
|
||||
|
||||
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ SyntaxError: /foo/bar/.projects/e2e/lib/fail.js: Unexpected token (2:0)
|
||||
> 2 |
|
||||
| ^
|
||||
@ ./cypress/integration/es_module_import_failing_spec.js 3:0-25
|
||||
[stack trace lines]
|
||||
|
||||
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ You may need an additional loader to handle the result of these loaders.
|
||||
| // because it tests failing spec.
|
||||
> describe('fail', - > );
|
||||
|
|
||||
[stack trace lines]
|
||||
|
||||
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ SyntaxError: /foo/bar/.projects/e2e/cypress/integration/stdout_exit_early_failin
|
||||
> 1 | +>
|
||||
| ^
|
||||
2 |
|
||||
[stack trace lines]
|
||||
|
||||
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ Looked for and couldn't find the file at the following paths:
|
||||
[/foo/bar/.projects/e2e/cypress/it/does/not/exist.ts]
|
||||
[/foo/bar/.projects/e2e/cypress/it/does/not/exist.tsx]
|
||||
@ ./cypress/integration/record_error_spec.js 3:0-31
|
||||
|
||||
[stack trace lines]
|
||||
|
||||
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
||||
|
||||
@@ -991,6 +993,8 @@ Looked for and couldn't find the file at the following paths:
|
||||
[/foo/bar/.projects/e2e/cypress/it/does/not/exist.ts]
|
||||
[/foo/bar/.projects/e2e/cypress/it/does/not/exist.tsx]
|
||||
@ ./cypress/integration/record_error_spec.js 3:0-31
|
||||
|
||||
[stack trace lines]
|
||||
|
||||
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ const appData = require('../util/app_data')
|
||||
const plugins = require('../plugins')
|
||||
|
||||
const errorMessage = function (err = {}) {
|
||||
return (err.stack || err.annotated || err.message || err.toString())
|
||||
.replace(/\n\s*at.*/g, '')
|
||||
.replace(/From previous event:\n?/g, '')
|
||||
return err.stack || err.annotated || err.message || err.toString()
|
||||
}
|
||||
|
||||
const clientSideError = function (err) {
|
||||
|
||||
@@ -185,8 +185,9 @@ describe('lib/plugins/preprocessor', () => {
|
||||
expect(preprocessor.errorMessage(err)).to.equal('message')
|
||||
})
|
||||
|
||||
it('removes stack lines', () => {
|
||||
expect(preprocessor.errorMessage('foo\n at what.ever (foo 23:30)\n baz\n at where.ever (bar 1:5)')).to.equal('foo\n baz')
|
||||
it('does not remove stack lines', () => {
|
||||
expect(preprocessor.errorMessage('foo\n at what.ever (foo 23:30)\n baz\n at where.ever (bar 1:5)'))
|
||||
.to.equal('foo\n at what.ever (foo 23:30)\n baz\n at where.ever (bar 1:5)')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user