SyntaxError:在此语句上运行量角器配置文件时意外导出令牌,*从'./public_api'导出*

时间:2018-12-21 10:58:09

标签: angular jasmine protractor e2e-testing

我收到了SyntaxError:

  

运行量角器配置文件时意外导出令牌

关于此声明export * from './public_api';
量角器版本:5.4.1 npm版本:6.5.0

发生语法问题的index.js中的代码

 export * from './public_api';
//# sourceMappingURL=index.js.map

protractor.conf.js具有下面的代码,看来在使用量角器时,ES6无法识别导出和导入:

  /**
 * @author: tipe.io
 */
require('ts-node/register');
require('babel-core/register')({ ignore: false });
const helpers = require('./helpers');
const Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');

exports.config = {
  //baseUrl: 'http://localhost:3000/',
  baseUrl: 'https://ztar:Jiant!Burger@good2go-test.ztarmobile.io/',
  //seleniumAddress: 'http://localhost:4444/wd/hub',

  /**
   * Use `npm run e2e`
   */
  specs: [
    helpers.root('protractor/**/**.e2e.ts'),
    helpers.root('protractor/**/*.e2e.ts')
  ],
  suites: {
   /* activationFlowCompatiblePhone: 'protractor/activation-flow-compatible-phone.e2e.ts',
    activationFlowIncompatiblePhone: 'protractor/activation-flow-incompatible-phone.e2e.ts',
    purchasePlanUsingNewCreditCard: 'protractor/purchase-plan-using-new-credit-card.e2e.ts',
    purchasePlanUsingExitingCreditCard: 'protractor/purchase-plan-using-existing-credit-card.e2e.ts'*/
   activationFlowGSMNewNumber:   'protractor/activation-flow-gsm-new-number.e2e.ts'
  },
  exclude: [],
  allScriptsTimeout: 11000,

  jasmineNodeOpts: {
    showTiming: true,
    showColors: true,
    isVerbose: true,
    includeStackTrace: false,
    defaultTimeoutInterval: 40000
  },

  directConnect: true,
  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: ["--headless", "--disable-gpu", "--no-sandbox"]
    }
  },

  onPrepare: function () {
    browser.ignoreSynchronization = true;
    browser.driver.manage().window().setPosition(0, 0);
    browser.driver.manage().window().maximize();
    jasmine.getEnv().addReporter(
      new Jasmine2HtmlReporter({
        savePath: 'protractor/report/'
      })
    );
   // require("babel-register");
   // require('babel-core/register')({ ignore: false   }); 
  },

  SELENIUM_PROMISE_MANAGER: false,
};

0 个答案:

没有答案