4

我正在尝试使用带有 mocha 测试框架的 karma-runner 来测试使用闭包库和 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();
    });
});
4

1 回答 1

2

我发现这个repo在使用 karma testrunner 设置 Google 关闭方面有一些指示。

于 2013-05-22T16:32:51.593 回答