Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何配置Angular2 Quickstart以运行phantomjs?_Javascript_Angular_Phantomjs_Karma Runner - Fatal编程技术网

Javascript 如何配置Angular2 Quickstart以运行phantomjs?

Javascript 如何配置Angular2 Quickstart以运行phantomjs?,javascript,angular,phantomjs,karma-runner,Javascript,Angular,Phantomjs,Karma Runner,我正试图找出如何使用phantomjs运行的测试 我认为这些步骤足以配置业力: 1。克隆存储库 $git克隆https://github.com/angular/quickstart.git $cd快速启动 2。安装phantomjs和phantomjs启动器 $npm安装--保存dev phantomjs $npm安装--保存dev karma phantomjs启动器 3。更改karma.conf.js //第一次更改 require('karma-chrome-launcher')=>re

我正试图找出如何使用phantomjs运行的测试

我认为这些步骤足以配置业力:

1。克隆存储库

$git克隆https://github.com/angular/quickstart.git

$cd快速启动

2。安装phantomjs和phantomjs启动器

$npm安装--保存dev phantomjs

$npm安装--保存dev karma phantomjs启动器

3。更改karma.conf.js

//第一次更改
require('karma-chrome-launcher')=>require('karma-phantomjs-launcher'))

//第二次更改
浏览器:['Chrome']=>浏览器:['PhantomJS']

4。安装快速启动应用程序

$npm安装

5。运行测试

$npm运行测试一次

报告了以下错误:

PhantomJS 2.1.1(Linux 0.0.0)错误 TypeError:undefined不是函数(正在评估'System.config') 在karma test shim.js:30

我错过了什么或做错了什么


谢谢。

之前有一个错误:404试图找到
系统polyfills.js

404:/base/node_modules/systemjs/dist/system-polyfills.js

如果将其添加到karma配置中,错误就会消失

files: [
  // System.js for module loading
  'node_modules/systemjs/dist/system.src.js',
  'node_modules/systemjs/dist/system-polyfills.js',

不太清楚区别是什么(为什么Chrome不需要它)。我猜是你的。你应该问他们。

是的,是我的。我要问他们。谢谢