The test lifecycle
2016-04-13 17:31
375 查看
每一个已注册的根用例:
The
setup method of the suite is called, if it exists
For each test within the suite:
The
beforeEach method of the suite is called, if it exists
The test function is called
The
afterEach method of the suite is called, if it exists
The
teardown method of the suite is called, if it exists
So, given the this test module:
…the resulting console output would be in this order:
The
setup method of the suite is called, if it exists
For each test within the suite:
The
beforeEach method of the suite is called, if it exists
The test function is called
The
afterEach method of the suite is called, if it exists
The
teardown method of the suite is called, if it exists
So, given the this test module:
define(function (require) { var registerSuite = require('intern!object'); registerSuite({ setup: function () { console.log('outer setup'); }, beforeEach: function () { console.log('outer beforeEach'); }, afterEach: function () { console.log('outer afterEach'); }, teardown: function () { console.log('outer teardown'); }, 'inner suite': { setup: function () { console.log('inner setup'); }, beforeEach: function () { console.log('inner beforeEach'); }, afterEach: function () { console.log('inner afterEach'); }, teardown: function () { console.log('inner teardown'); }, 'test A': function () { console.log('inner test A'); }, 'test B': function () { console.log('inner test B'); } }, 'test C': function () { console.log('outer test C'); } }); });
…the resulting console output would be in this order:
outer setup inner setup outer beforeEach inner beforeEach inner test A inner afterEach outer afterEach outer beforeEach inner beforeEach inner test B inner afterEach outer afterEach inner teardown outer beforeEach outer test C outer afterEach outer teardown
相关文章推荐
- JS的跨域理解
- JSON入门之二:org.json的基本用法
- css去掉iPhone、iPad默认按钮样式
- 2016.4.13--css总结
- JS获取节点的兄弟,父级,子级元素
- bootstrap左侧栏样式
- 原生js编写autoComplete插件
- JS中的eval 为什么加括号
- highcharts jquery实时更新
- Caffe与Lasagne使用——人脸关键点检测
- jquery例子
- js调试的常用五种方式
- jquery实现通用结构折叠面板效果
- 礼拜三log~为页面设置弹出框的办法
- Angular初学
- 关于js中插入删除节点的总结
- html盒子模型
- NIO中Channel、Buffer、Selector详解
- HTML 元素和有效的 DTD
- AngularJS ng-cloak 指令