chutzpah

Testing javascript with Chutzpah and requirejs

百般思念 提交于 2019-12-03 11:36:17
I just wonder if there is a simple tutorial showing how to test javascript in visual studio with Chutzpah, require.js and jasmine. Basically, i want to run the tests without using an .html file so that i can see the results in the vs test explorer. Adamy You can find some sample codes here: https://chutzpah.codeplex.com/SourceControl/latest#Samples/RequireJS/Jasmine/tests/base/base.jasmine.test.js Please note if you want to use requirejs with Chutzpah and Jasmine, you need to set TestHarnessReferenceMode to AMD in chutzpah.json. Otherwise the tests won't be ran in browser. { "Framework":

Unit testing using Jasmine and TypeScript

空扰寡人 提交于 2019-12-03 05:30:39
问题 I am trying to get a unit test written in Typescript using Jasmine to compile. With the following in my unit-test file, Resharper prompts me with a link to import types from jasmine.d.ts. /// <reference path="sut.ts" /> /// <reference path="../../../scripts/typings/jasmine/jasmine.d.ts" /> describe("Person FullName", function () { var person; BeforeEach(function () { person = new Person(); person.setFirstName("Joe"); person.setLastName("Smith"); }); It("should concatenate first and last names

Jasmine in a separate test project

£可爱£侵袭症+ 提交于 2019-12-02 20:21:15
Is it practical/possible to separate jasmine tests into a separate visual studio project? 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. I am assuming that since unit tests in Visual Studio are usually separated into a separate test project, by convention,

QUnit isn't running manually namespaced setup code like I would expect?

时光怂恿深爱的人放手 提交于 2019-12-02 19:23:38
问题 In stuff.js: function init() { return "works"; } (function(ParentNamespace) { ParentNamespace.MySubNamespace = {}; })(window.MyNamespace || (window.MyNamespace = {})); In my test JS file: /// <reference path="../../../project1/Shared/sub1/Javascript/stuff.js" /> test("foo test", function () { deepEqual(init(), "works", "couldn't access source JS file"); ok(window, "no window context"); var ns = window.MyNamespace; ok(ns in window, "namespace is bad"); var ns2 = window.MyNamespace