Created
October 12, 2014 16:26
-
-
Save tlvince/f625fa0e4909db3702f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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