如何在Mocha测试中检索当前测试的名称? [英] How can I retrieve the current test's name within a Mocha test?

查看:73
本文介绍了如何在Mocha测试中检索当前测试的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于其他日志记录,我需要能够打印当前测试的描述。

For additional logging, I need to be able to print the current test's description.

我该怎么办(使用Mocha BDD)?

How can I do this (with Mocha BDD)?

推荐答案

你走了:

console.log(this.title);

这篇关于如何在Mocha测试中检索当前测试的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆