【发布时间】:2019-08-08 19:53:59
【问题描述】:
在尝试为测试用例断言错误消息时收到问题
AssertionError: expected [Function] to throw an error
at Context.it (test\index.js:24:80)
if (configVms.rts) {
describe('Real Time Services', () => {
for(let rtsConfig of configVms["rts"].rtsConfig) {
it(`Real Time Services endpoints for guid ${rtsConfig.resourceId} on ${rtsConfig.platformType} platform`, async () => {
expect(async () => await realTimeServices.main(rtsConfig)).to.throw('Host rejected');
});
}});
}
【问题讨论】:
-
试试expect(await realTimeServices.main(rtsConfig)).to.throw('Host denied');
标签: javascript asynchronous mocha.js assert