Skip to content Skip to sidebar Skip to footer

Jasmine Specs Without Specrunner.html - Js Dependencies

I have unit tests for an application where the javascript I wanted to test was dependent on other JS frameworks (underscore.js, backbone.js, jQuery...). So when setting up the spec

Solution 1:

Depending on your IDE or Editor you are using you can specify dependencies in the same way you add references to files to get code completion.

E.g. in Visual Studio for example the format used is:

/// <reference path="~/lib/jasmine-2.0.0/jasmine.js" />
/// <reference path="~/lib/jasmine-2.0.0/jasmine-html.js" />
/// <reference path="~/lib/jasmine-2.0.0/console.js" />
/// <reference path="~/lib/jasmine-2.0.0/boot.js" />

/// <reference path="../../../../<ProjectName>/javascript/shared/jquery-1.7.2.min.js" />
/// <reference path="../../../../<PorjectName>/bundles/app.javascript.js" />

Where <ProjectName> is your project name and this is only the case as the Test Project is a separate Project from the main App

Post a Comment for "Jasmine Specs Without Specrunner.html - Js Dependencies"