forked from toji/gl-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed some bugs in the specs (code unaffected)
Sometimes testing the tests isn't overkill...
1 parent
37716ad
commit afa6d58
Showing
3 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
describe("spec helper", function() { | ||
var mock = null; | ||
describe("toBeEqualish", function() { | ||
beforeEach(function() { | ||
mock = function(actual) { | ||
return { | ||
actual: actual, | ||
equalish: HELPER_MATCHERS.toBeEqualish | ||
}; | ||
}; | ||
}); | ||
|
||
it("should fail if a is NaN and b is not", function() { | ||
expect(mock(NaN).equalish(1)).not.toBeTruthy() | ||
}); | ||
|
||
it("should fail if b is NaN and a is not", function() { | ||
expect(mock(1).equalish(NaN)).not.toBeTruthy() | ||
}); | ||
|
||
it("should fail if a is vec of NaN and b is not", function() { | ||
expect(mock([NaN, NaN, NaN, NaN]).equalish([1, 2, 3, 4])).not.toBeTruthy() | ||
}); | ||
|
||
it("should fail if b is vec of NaN and a is not", function() { | ||
expect(mock([1, 2, 3, 4]).equalish([NaN, NaN, NaN, NaN])).not.toBeTruthy() | ||
}); | ||
|
||
it("should not fail if a and b are the same", function() { | ||
expect(mock(1).equalish(1)).toBeTruthy() | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters