Sunday, February 12, 2017

First Jasmine Test I constructed outside of a Tutorial

In the File src/LoadString.js

function LoadFile() {};

LoadFile.prototype.start = 'hello';


-----------------------------------------------------------------------

 In the File spec/SpecLoadString.js




describe("LoadFile", function() {

    var start;

    //This will be called before running each spec
    beforeEach(function() {
        LoadFile = new LoadFile();
    });

   it("matches any value", function() {
      expect(LoadFile.start).toEqual(jasmine.any(String));
   });
});

-----------------------

changing  src/LoadString.js breaks it:

function LoadFile() {

let start = 'hello';
};

No comments:

Post a Comment