Skip to content

Commit

Permalink
Merge pull request #67 from texttechne/master
Browse files Browse the repository at this point in the history
Reset console spy before each test to make tests more robust
  • Loading branch information
AlexGilleran committed Jul 17, 2017
2 parents d5f0a51 + e2198f1 commit 823bcc9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions spec/test/choose.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ describe("requiring in component with choose/otherwise", function() {

describe("requiring in component with nested choose", function() {
var Fixture = require("../fixtures/choose/nested-choose.jsx");
var consoleSpy = chai.spy.on(console, "error");
var consoleSpy;

beforeEach(function() {
consoleSpy = chai.spy.on(console, "error");
});

it("should render when-when block when both conditions true", function() {
var rendered = util.render(Fixture, {outerWhen: true, innerWhen: true});
Expand Down Expand Up @@ -87,7 +91,11 @@ describe("requiring in component with nested choose and a key (issue #52)", func
// runs probably means it's OK but we'll do a proper test because why not.

var Fixture = require("../fixtures/choose/nested-choose-no-inner-component.jsx");
var consoleSpy = chai.spy.on(console, "error");
var consoleSpy;

beforeEach(function() {
consoleSpy = chai.spy.on(console, "error");
});

it("should render when-when block when both conditions true", function() {
var rendered = util.render(Fixture, {outerWhen: true, innerWhen: true});
Expand Down
6 changes: 5 additions & 1 deletion spec/test/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ describe("extension: multiple children", function() {
var FixtureChoose = require("../fixtures/extension/choose-with-multiple-children.jsx");
var FixtureFor = require("../fixtures/extension/for-with-multiple-children.jsx");

var consoleSpy = chai.spy.on(console, "error");
var consoleSpy;

beforeEach(function() {
consoleSpy = chai.spy.on(console, "error");
});


it("should allow for multiple children within <If>", function() {
Expand Down
6 changes: 5 additions & 1 deletion spec/test/if.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ describe("requiring in component with if/else", function() {

describe("requiring in component with nested if/else", function() {
var Fixture = require("../fixtures/if/nested-if.jsx");
var consoleSpy = chai.spy.on(console, "error");
var consoleSpy;

beforeEach(function() {
consoleSpy = chai.spy.on(console, "error");
});

it("should render if-if block when both conditions true", function() {
var rendered = util.render(Fixture, {ifCondition: true, nestedIfCondition: true});
Expand Down

0 comments on commit 823bcc9

Please sign in to comment.