无法运行量角器打字稿样本得到以下错误安装类型茉莉等

时间:2018-06-16 10:06:14

标签: typescript protractor

我无法运行量角器打字稿样本。我正在收到错误。我已经安装了jasmine等类型。

这是我的代码:

import {Config} from 'protractor';
export let config: Config = {
    framework: 'jasmine',
    capabilities: {
        browserName: 'chrome'
    },
    specs: [ 'spec.js' ],
    seleniumAddress: 'localhost:4444/wd/hub',
    // You could set no globals to true to avoid jQuery '$' and protractor '$'
    // collisions on the global namespace.
    noGlobals: true
};

我收到此错误:

root@localhost exampleTypescript]# protractor conf.ts
  [06:08:07] E/configParser - Error code: 105
  [06:08:07] E/configParser - Error message: failed loading configuration file conf.ts
  [06:08:07] E/configParser - /usr/lib/node_modules/protractor/exampleTypescript/conf.ts:11
  import {Config} from 'protractor';
  ^^^^^^

1 个答案:

答案 0 :(得分:0)

您应该运行protractor.conf.js而不是protractor.conf.ts。在tsconfig.js中,您为已编译文件设置了一个文件夹(从tsjs)= outDir属性。因此,您需要从protractor.conf.js中设置的文件夹中运行tsconfig,例如node ./dist/config/protractor.conf.js而不是node ./config/protractor.conf.js