1
当试图在浏览器中使用Mocha(version 1.3.2),沿the given example线,我想在the expected way到指定可接受的全局,当出现以下情况例外(即类似mocha.globals(['amplify', '_'])
):mocha.globals是“不确定”
Uncaught TypeError: Object function Mocha(options) {
options = options || {};
this.files = [];
this.options = options;
this.grep(options.grep);
this.suite = new exports.Suite('', new exports.Context);
this.ui(options.ui);
this.reporter(options.reporter);
if (options.timeout) this.suite.timeout(options.timeout);
} has no method 'globals'
这在Chrome 21.0.1180中展出。
可以通过转到given example link并在浏览器控制台中运行mocha.globals(['123'])
来重现此操作。
我期望mocha.globals
工作正如链接的例子所示,或者有一些关于替代文件的文档,但我没有找到。
跟进,在JS解决办法是:mocha.setup({UI: 'BDD',全局:[ '玉']}) – 2012-11-09 17:23:53