我有一个@Transactional方法,当事务在被调用后失败时,我必须测试它,例如: @Service @Transactionalservice failed in the transaction but after its real method has been correctly executed} 你能告诉我在我的测试中应该把什么代码放到
当测试骨干模型的事件是否使用sinon间谍触发时,它错误地出错了:expected doSomething to be called once but was called 0 times,尽管它似乎是在方法的主体中放置控制台日志时执行的= sinon.spy(model, 'doSomething'); sinon.assert.calledOnce(spy);我知道要修复这个问题,您必须将si