Wednesday, September 10, 2014

I am starting to experiment with Jasmine testing within Visual Studio using ReSharper to run the tests locally.

This works. I can run these tests out of a .js file with ReSharper.

/// <reference path="../jasmine.js" />
describe("whatever()", function () {
   var myNumber = 0;
   beforeEach(function () {
      myNumber = 1;
   });
   afterEach(function () {
      myNumber = 1;
   });
   it("one plus one is two", function () {
      myNumber = myNumber + myNumber;
      expect(myNumber).toBe(2);
   });
   it("one plus two is three", function () {
      myNumber = myNumber + 2;
      expect(myNumber).toBe(3);
   });
});

 
 

I got jasmine.js from here. I struggled today to figure out how to reference another file in the name of testing it. I'm still tinkering with that. More soon.

No comments:

Post a Comment