博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JavaScript test framework : Mocha
阅读量:6992 次
发布时间:2019-06-27

本文共 810 字,大约阅读时间需要 2 分钟。

Mocha is a feature-rich JavaScript test framework running on and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on .

INSTALLATION

Install with globally:

$ npm install --global mocha

or as a development dependency for your project:

$ npm install --save-dev mocha

Mocha currently requires Node.js v6.x or newer.

GETTING STARTED

$ npm install mocha$ mkdir test$ $EDITOR test/test.js # or open with your favorite editor

In your editor:

var assert = require('assert');describe('Array', function() {  describe('#indexOf()', function() {    it('should return -1 when the value is not present', function() {      assert.equal([1,2,3].indexOf(4), -1);    });  });});

转载地址:http://ocdvl.baihongyu.com/

你可能感兴趣的文章
MySQL的事务处理以及隔离级别
查看>>
常见的Web攻击手段——XSS攻击
查看>>
项目管理者促使企业信息化实施成功的条件
查看>>
CentOS最小安装之后做的一些小事
查看>>
【jQuery】----jQuery 多个库之间的冲突 (二)
查看>>
SSL证书卸载与SSI高级应用
查看>>
【Go语言】2.3流程和函数
查看>>
Develop app whit HK2
查看>>
[Material Design] MaterialButton 效果进阶 动画自动移动进行对齐效果
查看>>
Redis5.0.4复制
查看>>
SurfaceView必知
查看>>
EventDOM:事件DOM
查看>>
Sonar 配置代码扫描规则 与 质量配置,设置各个语言默认的扫描规则
查看>>
mybatis生成UUID主键,且获取当前新增的UUID主键
查看>>
让OSChina的Windows Phone客户端支持后退键
查看>>
HTML -对象 object 元素
查看>>
hibernate常见问题总结
查看>>
JVM调优工具
查看>>
怎么判断 Python 对象是否包含某个属性?
查看>>
锁的种类
查看>>