Skip to content

Commit

Permalink
matcher did not work correctly (always passed), because it used outda…
Browse files Browse the repository at this point in the history
…ted Jasmine api
  • Loading branch information
warpech committed Oct 16, 2013
1 parent f759dc8 commit 19ffb7e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/test-duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ if(typeof jsonpatch === 'undefined') {
}
}

describe("JSON-Patch-Duplex", function () {
beforeEach(function () {
this.addMatchers({
/**
* This matcher is only needed in Chrome 28 (Chrome 28 cannot successfully compare observed objects immediately after they have been changed. Chrome 30 is unaffected)
* @param obj
* @returns {boolean}
*/
jasmine.Matchers.prototype.toEqualInJSON = function(obj) {
return JSON.stringify(this.actual) == JSON.stringify(obj);
};
toEqualInJSON: function (expected) {
return JSON.stringify(this.actual) == JSON.stringify(expected);
}
});
});

describe("JSON-Patch-Duplex", function () {
describe("generate", function () {
it('should generate replace', function() {
obj = { firstName:"Albert", lastName:"Einstein",
Expand Down

0 comments on commit 19ffb7e

Please sign in to comment.