Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
Fix lint errors in term-spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolewhite committed Sep 5, 2015
1 parent 5561179 commit 94f4b1b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/term-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ describe("Terms", function() {
});

it("can't be initialized with an integer", function() {
expect(function(){new Term(5)}).toThrow("InvalidArgument");
expect(function(){new Term(5);}).toThrow("InvalidArgument");
});

it("can't be initialized with a float", function() {
expect(function(){new Term(5.1)}).toThrow("InvalidArgument");
expect(function(){new Term(5.1);}).toThrow("InvalidArgument");
});

it("can't be initialized with a string", function() {
expect(function(){new Term("x")}).toThrow("InvalidArgument");
})
expect(function(){new Term("x");}).toThrow("InvalidArgument");
});
});

describe("Term addition", function() {
Expand All @@ -43,14 +43,14 @@ describe("Term addition", function() {
var t2 = new Term(x);

answer = t1.add(t2);
expect(answer.toString()).toEqual("2x")
expect(answer.toString()).toEqual("2x");
});

it("throws an error if trying to combine unlike terms", function() {
var t1 = new Term(x);
var t2 = new Term(y);

expect(function(){t1.add(t2)}).toThrow("InvalidArgument");
expect(function(){t1.add(t2);}).toThrow("InvalidArgument");
});
});

Expand All @@ -65,14 +65,14 @@ describe("Term subtraction", function() {
t1.coefficients = [new Fraction(2, 1)];

var answer = t1.subtract(t2);
expect(answer.toString()).toEqual("x")
expect(answer.toString()).toEqual("x");
});

it("throws an error if trying to combine unlike terms", function() {
var t1 = new Term(x);
var t2 = new Term(y);

expect(function(){t1.subtract(t2)}).toThrow("InvalidArgument");
expect(function(){t1.subtract(t2);}).toThrow("InvalidArgument");
});
});

Expand Down Expand Up @@ -110,7 +110,7 @@ describe("Term multiplication", function() {
t2.coefficients = [new Fraction(3, 1)];

var answer = t1.multiply(t2);
expect(answer.toString()).toEqual("6xy")
expect(answer.toString()).toEqual("6xy");
});

it("allows multiplication of integers", function() {
Expand All @@ -133,7 +133,7 @@ describe("Term multiplication", function() {
var x = new Variable("x");
var t = new Term(x);

expect(function(){t.multiply(.5)}).toThrow("InvalidArgument");
expect(function(){t.multiply(0.5);}).toThrow("InvalidArgument");
});

it("allows unsimplified coefficients", function() {
Expand Down Expand Up @@ -171,14 +171,14 @@ describe("Term division", function() {
var t = new Term(x);

var answer = t.divide(new Fraction(2, 3));
expect(answer.toString()).toEqual("3/2x")
expect(answer.toString()).toEqual("3/2x");
});

it("doesn't allow division of floats", function() {
var x = new Variable("x");
var t = new Term(x);

expect(function(){t.divide(.5)}).toThrow("InvalidArgument");
expect(function(){t.divide(0.5);}).toThrow("InvalidArgument");
});

it("allows unsimplified terms", function() {
Expand Down

0 comments on commit 94f4b1b

Please sign in to comment.