所以我是javascript的新手,我一直在浏览别人的代码,我发现了这个..

describe('deviceready', function() {
    it('should report that it fired', function() {
        spyOn(app, 'report');
        app.deviceready();
        expect(app.report).toHaveBeenCalledWith('deviceready');
    });
});

我不明白的是:

info:
- Its a phonegap application
- We are using the spine.js and jQuery libraries

推荐答案

Describe is a function in the Jasmine testing framework. It simply describes the suite of test cases enumerated by the "it" functions.

Also used in the mochajs framework.

Jquery相关问答推荐

如何在html css中制作响应表

Jquery 表数据无法在 html 上正确显示

使用带有 bootstrap 验证的 Ajax 函数时出现问题

如何使用 jQuery 的 drop 事件上传从桌面拖动的文件?

更改高亮 colored颜色

Jquery Ajax,从 mvc.net 控制器返回成功/错误

如何制作 AngularJS 指令来停止传播?

如何在 Jquery 中通过索引获取子元素?

为特定请求禁用 ajaxStart() 和 ajaxStop()

$.each(selector) 和 $(selector).each() 有什么区别

如何使所有浏览器都支持 ?有什么 Select 吗?

如何使用 jQuery 更改文本

我想了解 jQuery 插件语法

你如何在Javascript中缓存图像

按文本 Select 链接(完全匹配)

如何使用 jQuery 或纯 JS 重置所有复选框?

如何使锚链接不可点击或禁用?

jQuery.active 函数

检测页面是否已完成加载

Ajax 处理中的无效 JSON 原语