【发布时间】:2015-10-11 13:26:53
【问题描述】:
如果我有一个抛出错误的函数并且我想测试该错误,我会写这样的代码:
test('throws at something that is not a string', t => {
t.plan(1)
t.err(loadString(9))
})
但这总是会导致函数在执行时出现实际错误:
还有not ok 1 no plan found 和not ok 2 no assertions found,这也很奇怪。我怎样才能确保它实际上没有抛出?
【问题讨论】:
标签: node.js testing tap node.js-tape