Win7x32, Maven, Karma, PhantomJS, Jasmine.
I'm working on a POC of javascript unit tests using the aforementioned stack. I just installed node along with the various plugins, so my versions are likely the latest.
My first test is exceptionally trivial:
(function() {
describe("data.daily", function() {
it("data should be empty", function() {
var dataDaily = new Data.Daily();
dataDaily.initialize(Config.AJAX_DAILY_DATA_BASE_URL, Config.MOCKDATA_AJAX_DAILY_DATA_BASE_URL);
expect(dataDaily.getData()).toBe({});
});
});
})();
This fails with the mystifying message:
Expected { } to be { }.
I've tried changing the "toBe()" argument to something else, like '{"xxx":"yyy"}' and this produces the expected:
Expected { } to be { xxx : 'yyy' }.
I don't understand why {} is not equal to {}.