简体   繁体   English

如何在 Jasmine 中为每个测试用例添加一个 id?

[英]How to add an id for each test case in Jasmine?

How can I add an ID for each test cases ( it ) in my script so that in my jasmine-jsReporter.js (my Jasmine reporter)?如何在我的脚本中为每个测试用例( it )添加一个 ID,以便在我的jasmine-jsReporter.js (我的 Jasmine 记者)中? Can I access this ID and make appear on my report?我可以访问此 ID 并使其出现在我的报告中吗?

Thank You!谢谢你!

You can name your it functions in Jasmine just like any other javascript function您可以在 Jasmine 中命名您的it函数,就像任何其他 javascript 函数一样

it("can be named like a normal function", function functionName() {
    //...
});

Hopefully that helps希望有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM