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

If a project module contains a re-exported object, the test fails #969

Closed
sky3d opened this issue Nov 16, 2016 · 4 comments
Closed

If a project module contains a re-exported object, the test fails #969

sky3d opened this issue Nov 16, 2016 · 4 comments
Assignees
Labels
AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: compiler TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@sky3d
Copy link

sky3d commented Nov 16, 2016

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

ERROR Cannot prepare tests due to an error.
SyntaxError: Unexpected token import 

What is the expected behavior?

Test passed

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

Add the re-exporting object to the any project module

export * from './mod'

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

Tested page URL: -

Test code

src/consts.js:

export const FOO = 42;

src/module.js:

export * from './consts'

tests/test.js:

import { expect } from 'chai';
import * as app from '../src/module';

fixture('Export Issue')

test('re-export using asterix', async() => {
    expect(app.FOO).to.eql(42);
});

Related links

http://www.ecma-international.org/ecma-262/6.0/#sec-exports
babel/babel#2877
babel/babel#4751

Specify your

  • operating system: : macOS Sierra v10.12.1
  • testcafe version: 0.10.0
  • node.js version: v7.0.0
@inikulin inikulin added AREA: server SYSTEM: compiler TYPE: bug The described behavior is considered as wrong (bug). labels Nov 16, 2016
@inikulin
Copy link
Contributor

The issue is caused by babel/babel#2877. This ticket contains workaround for the issue, we can try to do it on our side. @AndreyBelym can you try workaround on our side?

@AndreyBelym
Copy link
Contributor

Okay, I will try it.

@inikulin inikulin added this to the Sprint #2 milestone Nov 16, 2016
@AndreyBelym
Copy link
Contributor

Yep, the workaround works. I am creating the PR.

AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Nov 16, 2016
AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Nov 16, 2016
georgiy-abbasov pushed a commit to georgiy-abbasov/testcafe-phoenix that referenced this issue Feb 13, 2017
georgiy-abbasov pushed a commit to georgiy-abbasov/testcafe-phoenix that referenced this issue Feb 13, 2017
inikulin pushed a commit that referenced this issue Feb 21, 2017
…1236)

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

* Approach changed, added regression test for gh-969

* another one approach

* One more approach

* Remarks fixed
@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#971)

* Add workaround for broken re-export (closes DevExpress#969)

* Add NOTE

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

No branches or pull requests

3 participants