Skip to content

Commit

Permalink
Approach changed, added regression test for gh-969
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgiy Abbasov committed Feb 13, 2017
1 parent 4acfc3e commit 8603d49
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/es-next/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export default class ESNextCompiler {
static _getBabelOptions (filename) {
var { presetStage2, transformRuntime, presetEnv } = loadBabelLibs();

// NOTE: passPrePreset and complex presets is a workaround for https://github.com/babel/babel/issues/2877
// NOTE: "[transformRuntime, { polyfill: false }]" is a workaround for https://github.com/babel/babel/issues/2877
// Fixes https://github.com/DevExpress/testcafe/issues/969
return {
presets: [presetStage2, presetEnv],
plugins: [transformRuntime],
plugins: [[transformRuntime, { polyfill: false }]],
filename: filename,
sourceMaps: true,
retainLines: true,
Expand Down
15 changes: 15 additions & 0 deletions test/server/compiler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,21 @@ describe('Compiler', function () {
});
});

it('Should successfully compile tests if re-export is used', function () {
this.timeout(5000);

var src = 'test/server/data/test-suites/regression-gh-969/testfile.js';
var compiler = new Compiler([src]);

return compiler
.getTests()
.then(function (tests) {
var test = tests[0];

return test.fn(testRunMock);
});
});

it('Incorrect callsite stack in error report if "import" is used (GH-1226)', function () {
this.timeout(5000);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const FOO = 42;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './consts'
8 changes: 8 additions & 0 deletions test/server/data/test-suites/regression-gh-969/testfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect } from 'chai';
import * as app from './helpers/module.js';

fixture('Export Issue');

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

0 comments on commit 8603d49

Please sign in to comment.