Skip to content

Broken Source Maps or Stack Traces for async functions after upgrading from 3.1.0 to 3.1.1 #2528

@donaldpipowitch

Description

@donaldpipowitch

Given a test like this:

import 'babel-polyfill';
import expect from 'expect';

describe('test my code', () => {
  it('should show my app', async (): Promise<any> => {
    expect(2).toBe(1);
  });
});

3.1.1 shows:

ERROR: 'Unhandled promise rejection', TypeError{stack: 'fail@http://localhost:9876/absolute/Users/foo/Workspace/project/node_modules/mocha/mocha.js?60c338ed8db7987f07880c121c83fed2648782f6:4726:6

And also:

10 10 2016 15:35:06.809:WARN [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
      Disconnected, because no message in 10000 ms.

3.1.0 correctly reports an error with a correct stack trace and isn't disconnected from PhantomJS. (I guess the promise rejection is handled correctly.)

Note that I use an async function here. (In my real test I also await something, but it is not necessary to do that to reproduce the error.

Maybe it was introduced by fixing #1417?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: browserbrowser-specifictype: buga defect, confirmed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions