Skip to content

Instantly share code, notes, and snippets.

@tlvince
Created October 12, 2014 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlvince/f625fa0e4909db3702f1 to your computer and use it in GitHub Desktop.
Save tlvince/f625fa0e4909db3702f1 to your computer and use it in GitHub Desktop.
'use strict';
describe('Angular PouchDB', function() {
beforeEach(module('pouchdb'));
var $rootScope, db;
beforeEach(inject(function(_$rootScope_, PouchDB) {
$rootScope = _$rootScope_;
db = new PouchDB('db');
}));
it('should return Angular promises', function() {
var promise = db.info();
expect(promise.finally).toBeDefined();
});
it('should resolve a promise', function(done) {
db.info()
.then(function(info) {
expect(info).toBeDefined();
})
.finally(done);
$rootScope.$digest();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment