我如何专注于 jasmine.js 中的一个规范? [英] How do I focus on one spec in jasmine.js?

查看:15
本文介绍了我如何专注于 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屋!

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