茉莉花在一个单独的测试项目 [英] Jasmine in a separate test project

查看:175
本文介绍了茉莉花在一个单独的测试项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它实际/可能茉莉花测试分离到一个单独的Visual Studio项目?

Is it practical/possible to separate jasmine tests into a separate visual studio project?

我刚开始接触角,并正尝试之前,我开始实际执行的角度来写我的测试。我将在的Visual Studio 2012中放肆测试运行在写我的项目,看到这的视频。目前,我试图找出如何安排我的文件夹结构。我知道角种子和自耕农,但这些都是不适合于启动.NET项目。

I am just getting started with angular, and am trying to write my tests before I start on the actual angular implementation. I will be writing my project in Visual Studio 2012 with the Chutzpah test runner, see this video. Currently, I am trying to figure out how to organize my folder structure. I know about angular-seed and yeoman, but those are ill suited to starting a .net project.

我假设,因为在Visual Studio中的单元测试通常是分离到一个单独的测试项目,按照惯例,茉莉测试也应该这样。

I am assuming that since unit tests in Visual Studio are usually separated into a separate test project, by convention, the jasmine tests should, too.

不过,对于Java脚本,有没有项目的dll引用,所以分离出来的测试到不同的项目将需要大量的复制和粘贴,我想。

However, for java script, there are no project dlls to reference, so separating the tests out into a different project would require a lot of copy and pasting, I think.

推荐答案

您可以用没有复制/粘贴做到这一点。在你茉莉的测试,您可以添加 ///<参考注释的帖子送到你的源文件(或包含它们的目录)。例如,给定这个内在张力结构。

You can do this with no copy/pasting. In your Jasmine tests you can add a /// <reference comment which posts to your source files (or the directory containing them). For example given this sturcture

/项目A /脚本

code1.js
code2.js


  
  

/ TestProjectB test1.js

/TestProjectB test1.js

您可以在您test1.js的顶部添加此行文件,以引用您的所有code文件:

You can add this line at the top of your test1.js file to reference all your code files:

//// <reference path="../scripts" />

这篇关于茉莉花在一个单独的测试项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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