我想覆盖一个函数“它”。我能做到?
old_it = it
it = (name, foo) ->
console.log('111')
old_it(name, foo)
console.log('222')
当我运行此代码时,会向控制台输出一条消息“it = undefined”
我想覆盖一个函数“它”。我能做到?
old_it = it
it = (name, foo) ->
console.log('111')
old_it(name, foo)
console.log('222')
当我运行此代码时,会向控制台输出一条消息“it = undefined”
您需要更正文件 wdio.conf.js 中的beforeTest和afterTest属性
...
beforeTest: function (test, context) {
console.log('start test ' + test.title)
},
...
afterTest: function(test, context, { error, result, duration, passed, retries }) {
console.log('finish test ' + test.title)
},
...