Skip to content

Commit

Permalink
adding expectation that options object passed into exec for compass i…
Browse files Browse the repository at this point in the history
…s undefined if we do not pass anything into JS api
  • Loading branch information
filmaj committed Apr 3, 2012
1 parent aeaee71 commit 0ff2165
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/test.compass.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ describe("compass", function () {
utils = require('cordova/utils'),
exec = require('cordova/exec');

exec.reset();
beforeEach(function() {
exec.reset();
});

describe("when getting the current heading", function () {
it("logs an error and doesn't call exec when no success callback given", function () {
Expand Down Expand Up @@ -33,7 +35,7 @@ describe("compass", function () {
f = function () {};

compass.getCurrentHeading(s, f);
expect(exec).toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function), "Compass", "getHeading", []);
expect(exec).toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function), "Compass", "getHeading", [undefined]);
});
});

Expand Down Expand Up @@ -96,7 +98,7 @@ describe("compass", function () {

//exec the interval callback!
window.setInterval.mostRecentCall.args[0]();
expect(exec).toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function), "Compass", "getHeading", []);
expect(exec).toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function), "Compass", "getHeading", [undefined]);
});
});

Expand Down

0 comments on commit 0ff2165

Please sign in to comment.