fix: Remove truncation of preprocessor errors (#15198)

This commit is contained in:
Chris Breiding
2021-02-24 16:28:45 -05:00
committed by GitHub
parent c3af3dcdef
commit f81dfecef4
7 changed files with 13 additions and 5 deletions

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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) {

View File

@@ -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)')
})
})
})