Skip to content

Instantly share code, notes, and snippets.

@1dolinski
Last active June 15, 2016 02:46
Show Gist options
  • Select an option

  • Save 1dolinski/ee95f1f89e2d5bc32a49b506d656ada5 to your computer and use it in GitHub Desktop.

Select an option

Save 1dolinski/ee95f1f89e2d5bc32a49b506d656ada5 to your computer and use it in GitHub Desktop.
var FireFunc = require("../js/services-fb-functions.js");
describe('Firebase Testing Suite', function() {
var firebase;
var testPath;
var testResult = {};
beforeAll(function() {
var firebaseFunctions = ['check']
firebase = jasmine.createSpyObj('firebase', firebaseFunctions)
firebase.check.and.callFake(function() {
return 2
});
});
describe('check', function() {
it('is working?', function() {
var x = FireFunc.zset()
expect(x).toBe(3); // THIS IS RETURNING 1... which means the spyOn doesn't work for me !
});
});
var firebase = {};
firebase.check = function() {
return 1;
}
module.exports = {
zset: function() {
return firebase.check();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment