【发布时间】:2013-09-22 10:44:20
【问题描述】:
像 before(), after(), beforeEach(), afterEach() 这样的 mocha 钩子不起作用。 only 方法也不起作用。没有一个 beforeEach 被调用。我收到一个错误has no method 'only'。下面是代码。
describe('Array', function(){
beforeEach(function(){
console.log('before every test')
})
describe.only('#indexOf()', function(){
beforeEach(function(){
console.log('before every test')
})
it.only('should return -1 unless present', function(){
assert.equal(1,2)
})
it('should return the index when present', function(){
assert.equal(1,2);
})
})
})
beforeEach(function(){
console.log('before every test')
})
【问题讨论】:
标签: mocha.js