Skip to content

Commit

Permalink
Add tests to experiment.
Browse files Browse the repository at this point in the history
Add tests to experiment.
  • Loading branch information
ozzimpact committed Feb 20, 2016
1 parent 2cb6165 commit db8598a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/experiment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,34 @@ describe("Experiment:", () => {
experiment.publishers.length.should.be.equal(0);
});

it("should set publishers list externally.", ()=> {
let mockPublishers = [{}];
//make sure publishers is empty
experiment.publishers.length.should.be.equal(0);

experiment.publishers = mockPublishers;
experiment.publishers.length.should.be.equal(mockPublishers.length);
});

it("should set name externally.", ()=> {
let mockName = "mockName";
//make sure that name is set to default value
experiment.name.should.be.equal("Experiment");

experiment.name = mockName;
experiment.name.should.be.equal(mockName);

});

it("should set runIf to false.", ()=> {

//make sure that runIf set to default value
experiment._runIf.should.be.equal(true);

experiment.runIf(false);
experiment._runIf.should.be.equal(false);

})

});

Expand Down

0 comments on commit db8598a

Please sign in to comment.