2017-04-25 58 views
1

我目前遇到了与运行Karma的ngx-bootstrap有关的问题。 问题是“铬57.0.2987(视窗10 0.0.0)错误 遗漏的类型错误:无法读取的不确定 财产 '输出' 在node_modules/NGX-引导/包/ NGX-bootstrap.umd.js:8087angular-ngx-bootstrap在运行业务单元测试时抛出错误

我使用的是角4.0.0和”ngx-bootstrap“:”^ 1.6.6“。下面是我的配置

1的package.json

"dependencies": 
    { 
     "@angular/common": "~4.0.0", 
     ........................ 
     "ngx-bootstrap": "^1.6.6" 
    } 

2. Systemjs.config.js

System.config({ 
    ...................... 
    map: {    
     // angular bundles 
     .............................. 
     'ngx-bootstrap': 'npm:ngx-bootstrap/bundles/ngx-bootstrap.umd.js',      
    } 

}); 

3 karma.conf.js

module.exports = function (config) { 
.................. 
config.set({ 
    basePath: '', 
    frameworks: ['jasmine'], 
    plugins: [ 
     require('karma-jasmine'), 
     require('karma-chrome-launcher'), 
     require('karma-jasmine-html-reporter'), // click "Debug" in browser to see it 
     require('karma-htmlfile-reporter') // crashing w/ strange socket error 
    ], 
    files: [   
     ................... 
     'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.js',   
    ]  

............
}) }

请帮我弄清楚这个问题。 (Web应用程序运行良好,使用ngx-bootstrap)

谢谢!

回答

1

karma.conf.js,替换:

node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.js 

有:

{ 
    pattern: 'node_modules/ngx-bootstrap/bundles/ngx-bootstrap.umd.js', 
    included: false, 
    watched: false 
} 

然后它工作。

+0

这解决了我的问题,谢谢 – gdyrrahitis

相关问题