Skip to content
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

Incorrect callstack for test error #1226

Closed
AlexanderMoskovkin opened this issue Feb 10, 2017 · 4 comments
Closed

Incorrect callstack for test error #1226

AlexanderMoskovkin opened this issue Feb 10, 2017 · 4 comments
Labels
AREA: server !IMPORTANT! STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: reporting TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

Are you requesting a feature or reporting a bug?

bug

What is the current behavior?

         at <anonymous> (d:\temp\help.js:2:11)
!!!!     at step (d:\temp\help.js:1:538)
!!!!     at <anonymous> (d:\temp\help.js:1:778)
!!!!     at <anonymous> (d:\temp\help.js:1:439)
!!!!     at exports.default (d:\temp\help.js:4:42)
         at <anonymous> (d:\temp\test1.js:9:11)
!!!!     at step (d:\temp\test1.js:3:364)

What is the expected behavior?

         at <anonymous> (d:\temp\help.js:2:11)
         at <anonymous> (d:\temp\test1.js:9:11)

How would you reproduce the current behavior (if this is a bug)?

run the test

Provide the test code and the tested page URL (if applicable)

Tested page URL: any

Test code

// test.js
import help from './help.js';

fixture `Fixture`
    .page `http://devexpress.github.io/testcafe/example/`;

test('test', async t => {
    await help(t);
})

// help.js
export default async function (t) {
    throw new Error('error');
}

Specify your

  • operating system: win7
  • testcafe version: 0.13.0-alpha2
  • node.js version: 7.4.0, 6.9.1, 0.10.47
@AlexanderMoskovkin AlexanderMoskovkin added !IMPORTANT! AREA: server SYSTEM: reporting TYPE: bug The described behavior is considered as wrong (bug). labels Feb 10, 2017
@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #4 milestone Feb 10, 2017
@AlexanderMoskovkin AlexanderMoskovkin changed the title Incorrect callstack when the test is failed Incorrect callstack when test is failed Feb 10, 2017
@AlexanderMoskovkin AlexanderMoskovkin changed the title Incorrect callstack when test is failed Incorrect callstack for test error Feb 10, 2017
@georgiy-abbasov
Copy link
Contributor

Lines marked with exclamation point are related to asyncToRegenerator calls (it replaces async keyword in the original code). It placed in the first line of transpilled code

'use strict';var _promise = require('D:\\Work\\testcafe-phoenix\\node_modules\\babel-runtime\\core-js\\promise.js');var _promise2 = _interopRequireDefault(_promise);var _help = require('./help.js');var _help2 = _interopRequireDefault(_help);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _asyncToGenerator(fn) {return function () {var gen = fn.apply(this, arguments);return new _promise2.default(function (resolve, reject) {function step(key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {return _promise2.default.resolve(value).then(function (value) {step("next", value);}, function (err) {step("throw", err);});}}return step("next");});};}

fixture`Fixture`.
page`http://devexpress.github.io/testcafe/example/`;

test('test', (() => {var _ref = _asyncToGenerator(function* (t) {
        yield (0, _help2.default)(t);
    });return function (_x) {return _ref.apply(this, arguments);};})());

@inikulin says, that it should be imported, not placed in the code.

@georgiy-abbasov
Copy link
Contributor

During testing approach, which @inikulin recommended, i've found that odd lines still here:

at <anonymous> (D:\work\testcafe-phoenix\gh-1226\help.js:2:11)
at F (D:\work\testcafe-phoenix\node_modules\core-js\library\modules\_export.js:35:28)
at exports.default (D:\work\testcafe-phoenix\gh-1226\help.js:3:42)
at <anonymous> (D:\work\testcafe-phoenix\gh-1226\node.test.js:7:11)

It's due to the fact, that transpilled require and export keywords are shifted too.

@inikulin
Copy link
Contributor

@georgiy-abbasov Which of them are odd? If you are talking about core-js stuff - yes, they should be filtered out by stack filter. Debug to figure out why they still where.

@lock
Copy link

lock bot commented Mar 29, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 29, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…ss#1226) (DevExpress#1236)

* Changed babel options to avoid extra lines in report (closes DevExpress#1226)

* Approach changed, added regression test for DevExpressgh-969

* another one approach

* One more approach

* Remarks fixed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: server !IMPORTANT! STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: reporting TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

3 participants