Jasmine
Jasmine
https://www.npmjs.com/package/jasmine
The Jasmine Module
The
jasminemodule is a package of helper code for developing Jasmine projects for Node.js.The core of jasmine lives at https://github.com/jasmine/jasmine and is
jasmine-corein npm.Contents
This module allows you to run Jasmine specs for your Node.js code. The output will be displayed in your terminal by default.
Installation
# Local installation:npm install --save-dev jasmine# Global installationnpm install -g jasmineInitializing
To initialize a project for Jasmine
jasmine initTo seed your project with some examples
jasmine exampleshttps://jasmine.github.io/setup/nodejs.html
Note that if you installed Jasmine locally you could still use the command line like this:
node node_modules/jasmine/bin/jasmine init
DEMO
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect(true).toBe(true);
});
});

API
https://jasmine.github.io/api/3.0/global.html#expect
describe(description, specDefinitions)
Create a group of specs (often called a suite).
Calls to describe can be nested within other calls to compose your suite as a tree.
Parameters:
| Name | Type | Description |
|---|---|---|
description |
String |
Textual description of the group |
specDefinitions |
function |
Function for Jasmine to invoke that will define inner suites and specs |
expect(actual) → {matchers}
Create an expectation for a spec.
Parameters:
| Name | Type | Description |
|---|---|---|
actual |
Object |
Actual computed value to test expectations against. |
Jasmine的更多相关文章
- jasmine入门
本文来自http://blog.fens.me/nodejs-jasmine-bdd 粉丝日志 张丹 前言TDD(Test Driven Development)测试驱动开发,是敏捷开发中提出的最 ...
- angularjs自动化测试系列之jasmine
angularjs自动化测试系列之jasmine jasmine参考 html <!DOCTYPE html> <html lang="en"> <h ...
- Karma+Jasmine实现自动化单元测试
1.Karma介绍 Karma是Testacular的新名字,在2012年google开源了Testacular,2013年Testacular改名为Karma.Karma是一个让人感到非常神秘的名字 ...
- JavaScript测试工具比较: QUnit, Jasmine, and Mocha
1. QUnit A JavaScript Unit Testing framework. QUnit is a powerful, easy-to-use JavaScript unit testi ...
- 基于Angularjs+jasmine+karma的测试驱动开发(TDD)实例
简介(摘自baidu) 测试驱动开发,英文全称Test-Driven Development,简称TDD,是一种不同于传统软件开发流程的新型的开发方法.它要求在编写某个功能的代码之前先编写测试代码,然 ...
- Jasmine测试ng Promises - Provide and Spy
jasmine提供了很多些很实用的处理Promises的方法,首先我们来考虑下面的这个例子: angular.module("myApp.store").controller(&q ...
- Jasmine入门(上)
什么是Jasmine Jasmine是一个Javascript的BDD(Behavior-Driven Development)测试框架,不依赖任何其他框架. 如何使用Jasmine 从Github上 ...
- Jasmine入门(结合示例讲解)
参考: http://www.cnblogs.com/wushangjue/p/4541209.html http://keenwon.com/1191.html http://jasmine.git ...
- angular测试-Karma + Jasmine配置
首先讲一下大致的流程: 需要node环境,首先先要安装node,node不会?请自行搜索.版本>0.8 安装node完成之后先要测试下npm是否测试通过,如下图所示 首先看下目录结构 目录为:F ...
- 使用jasmine来对js进行单元测试
互联网的快速发展,给web开发人员带来了前所未有的挑战.对于前端开发,前端开发er所需要编写的js早已不是那些寥寥几行的视觉效果代码.代码量的大增,多人协同,人员素质悬殊不齐,这都需要一个标准,来对代 ...
随机推荐
- socket接收大数据流
客户端: import socket client = socket.socket() client.connect(("127.0.0.1", 9999)) while True ...
- 【Python 17】B分R计算器1.0(数值类型)
1.案例描述 基础代谢率(BMR):我们安静状态下(通常为静卧状态)消耗的最低热量,人的其他活动都建立在这个基础上. 计算公式: BMR(男) = (13.7*体重kg)+(5.0*身高cm)-(6. ...
- day8-基础函数的学习(三)
开始今日份总结 今日目录 1.生成器 2.列表推导式 3.匿名函数 4.装饰器 开始今日份总结 1.生成器 1.1 生成器的定义 定义:生成器本质就是迭代器,生成器是自己用python代码写的迭代器 ...
- 百度杯”CTF比赛 九月场 123
进去后让登录,先看源码有提示 进到user.php 后发现是空的,看了wp才知道,有bak 下载下来直接爆破 但是那个1990是蛮骚的 直接进去登录 登录成功后是空的,走fd看看是怎么过 的 改包然后 ...
- SpringCloud(3)服务消费者(Feign)
上一篇文章,讲述了如何通过 RestTemplate+Ribbon 去消费服务,这篇文章主要讲述如何通过Feign去消费服务. 1.Feign简介 Feign是一个声明式的伪Http客户端,它使得写H ...
- 机智的造假->sql给Echart提供数据
数据要求:要求数据随着上班时间的延长要递增,要看起来像真数据 declare @key int; declare cur_rate cursor for select keyID from #t1; ...
- mysql监控每一条执行的sql语句
查看日志配置是否打开 SHOW VARIABLES LIKE "general_log%"; SET GLOBAL general_log = 'ON'; 打开日志 SET G ...
- 如何查看kernel社区的变更历史
kernel社区稳定版本的地址为: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ 如果我们想查找某一个文件,比如 ...
- 整合Spring5+Struts2.5+Hibernate5+maven
1. 使用Eclipse创建Maven项目 2. 配置pom.xml引入需要的依赖包 <dependencies> <dependency> <groupId>ju ...
- Lodop简短问答客户反馈篇 及排查步骤 及注册相关
A.http下打印图片正常,https下打印图片是××.(有的客户端可以,有的不可以)重置ie浏览器试试.客户反馈:(和ie浏览器的设置有关)intenet选项--高级里,我调整为和能打印出图片的电脑 ...