如何配置卡玛亚军(也称为testacular)与封库工作 [英] How to configure karma-runner (also known as testacular) to work with closure-library
本文介绍了如何配置卡玛亚军(也称为testacular)与封库工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图用卡玛亚军与摩卡测试框架来测试封库和angularjs构建的应用程序。
我总是 namespace.Application没有定义
先谢谢了。
这是我的配置文件
基本路径='';文件= [
摩卡
MOCHA_ADAPTER,
{模式:供应商/闭库/关闭/ goog / base.js,眼睁睁地看着:假的,包括:真实,历任:真正},
{模式:公共/ Java脚本/ deps.js,观看视频:真实的,包括:真实,历任:真正},
{模式:node_modules / expect.js / expect.js,眼睁睁地看着:假的,包括:真实,历任:真正},
{模式:'公/ Java脚本/ * JS,观看视频:真,包括:虚假,历任:真正},
{模式:'测试/ * test.js,观看视频:真实的,包括:真实,历任:真正}
];
排除= [
];
记者= ['进步'];
端口= 9876;
runnerPort = 9100;
颜色= TRUE;
LOGLEVEL = LOG_INFO;
autoWatch =真;
浏览器= ['铬','火狐'];
captureTimeout = 60000;
singleRun = FALSE;
和这里有一个简单的测试文件
goog.require('namespace.Application');描述(一些样本,函数(){
它('应该做的事,功能(完成){
的console.log('asdasd,reAdoptAHydrant);
完成();
});
});
解决方案
我发现这个回购一>在建立谷歌封果报TestRunner的一些指点。
I'm trying to use karma-runner with mocha testing framework to test an application built with closure-library and angularjs.
I always get namespace.Application is not defined
thanks in advance.
here's my config file
basePath = '';
files = [
MOCHA,
MOCHA_ADAPTER,
{pattern: 'vendors/closure-library/closure/goog/base.js', watched: false, included: true, served: true},
{pattern: 'public/javascripts/deps.js', watched: true, included: true, served: true},
{pattern: 'node_modules/expect.js/expect.js', watched: false, included: true, served: true},
{pattern: 'public/javascripts/*.js', watched: true, included: false, served: true},
{pattern: 'tests/*.test.js', watched: true, included: true, served: true}
];
exclude = [
];
reporters = ['progress'];
port = 9876;
runnerPort = 9100;
colors = true;
logLevel = LOG_INFO;
autoWatch = true;
browsers = ['Chrome', 'Firefox'];
captureTimeout = 60000;
singleRun = false;
and here's a simple test file
goog.require('namespace.Application');
describe('some sample', function() {
it('should do something', function(done){
console.log('asdasd', reAdoptAHydrant);
done();
});
});
解决方案
I found this repo has some pointers in setting up Google closure with karma testrunner.
这篇关于如何配置卡玛亚军(也称为testacular)与封库工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文