前端自動化測試解決方案探析(2)

發表于:2016-11-23來源:ouven作者:ouven點擊數: 標簽:前端
$ npm install mocha$ mkdir test$ $EDITOR test/test.js # or open with your favorite editor 測試用例: var assert = require ( assert ); describe ( Array , function () { describe ( #indexOf() , func

$ npm install mocha
$ mkdir test
$ $EDITOR test/test.js # or open with your favorite 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, [1,2,3].indexOf(4));
    });
  });
});

原文轉自:http://jixianqianduan.com/frontend-javascript/2016/11/22/front-end-auto-test.html

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97