JavaScript中的'describe'关键字 [英] The 'describe' keyword in javascript
本文介绍了JavaScript中的'describe'关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我是javascript的新手,我一直在浏览其他人的代码,所以发现了这一点.
So I am a newbie in javascript and i had been going through some one else's code and I found this..
describe('deviceready', function() {
it('should report that it fired', function() {
spyOn(app, 'report');
app.deviceready();
expect(app.report).toHaveBeenCalledWith('deviceready');
});
});
我不明白的是:
describe
关键字到底能做什么?
What I don't understand is:
What exactly does the describe
keyword do?
信息:
-它的 phonegap 应用程序
-我们正在使用 spine.js 和 jQuery 库
info:
- Its a phonegap application
- We are using the spine.js and jQuery libraries
推荐答案
描述是 Jasmine 中的函数测试框架.它仅描述了"it"功能枚举的测试用例套件.
Describe is a function in the Jasmine testing framework. It simply describes the suite of test cases enumerated by the "it" functions.
还在 mochajs 框架中使用.
这篇关于JavaScript中的'describe'关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文