gpt4 book ai didi

angularjs - 如何配置 karma-runner(也称为 testacular)以使用closure-library

转载 作者:行者123 更新时间:2023-12-01 01:57:21 27 4
gpt4 key购买 nike

我正在尝试将 karma-runner 与 mocha 测试框架一起使用来测试使用closure-library 和 angularjs 构建的应用程序。

我总是收到 namespace.Application is not defined
提前致谢。

这是我的配置文件

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;

这是一个简单的测试文件
goog.require('namespace.Application');

describe('some sample', function() {
it('should do something', function(done){
console.log('asdasd', reAdoptAHydrant);
done();
});
});

最佳答案

我找到了这个 repo有一些关于使用 karma testrunner 设置 Google 关闭的提示。

关于angularjs - 如何配置 karma-runner(也称为 testacular)以使用closure-library,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16531590/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com