我如何专注于 jasmine.js 中的一个规范? [英] How do I focus on one spec in jasmine.js?
问题描述
我有一堆失败的规范来自一个相当大的架构更改.我想通过用焦点"标记每一个来一一修复它们.
I have a bunch of failing specs from a rather large architectural change. I'd like to work on fixing them one by one by tagging each one with 'focus'.
jasmine.js 有这样的功能吗?我发誓我曾经读过它,但我没有在文档中看到它.
Does jasmine.js have a feature like this? I swore I read at one point that it does but I don't see it in the docs.
推荐答案
您可以使用规范的 url 运行单个规范
You can run a single spec by using the url for the spec
describe("MySpec", function() {
it('function 1', function() {
//...
})
it('function 2', function() {
//...
}
})
现在您可以通过这个 url http://localhost:8888?spec=MySpec
运行整个规范,并使用 http://localhost:8888?spec 进行第一次测试=MySpec+函数+1
Now you can run just the whole spec by this url http://localhost:8888?spec=MySpec
and a the first test with http://localhost:8888?spec=MySpec+function+1
这篇关于我如何专注于 jasmine.js 中的一个规范?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!