firebase-admin
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -189,3 +189,4 @@ | ||
* {@link FirebaseInstance} if successful and rejects with an Error if | ||
* there's an error. | ||
* there's an error. This instance also has an extra method, tearDown, that | ||
* deletes the database. | ||
* @example | ||
@@ -204,3 +205,13 @@ * FirebaseAccount.bootstrapInstance('me@foo.com', 'foobar') | ||
return new FirebaseAccount(email, password).ready.then(function(acct) { | ||
return acct.createDatabase(Math.random().toString(36).slice(2)); | ||
return acct.createDatabase(Math.random().toString(36).slice(2)) | ||
.then(function(db) { | ||
db.tearDown = function() { | ||
return acct.deleteDatabase(db); | ||
}; | ||
return db; | ||
}); | ||
}); | ||
@@ -207,0 +218,0 @@ |
{ | ||
"name": "firebase-admin", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Programmatically instantiate and modify Firebase instances.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -110,8 +110,23 @@ | ||
var instancePromise; | ||
before(function() { | ||
instancePromise = FirebaseAccount.bootstrapInstance(fbUser, fbPass); | ||
}); | ||
it('promises to create a new database with a random name immediately', function() { | ||
return (expect( FirebaseAccount.bootstrapInstance(fbUser, fbPass) )).to.be.fulfilled; | ||
return expect(instancePromise).to.be.fulfilled; | ||
}); | ||
it('has a tearDown property that can be used to delete the database', function() { | ||
return expect(instancePromise.then(function(instance) { | ||
expect(instance.tearDown).to.be.a('function'); | ||
return expect(instance.tearDown()).to.be.fulfilled; | ||
})).to.be.fulfilled; | ||
}); | ||
}); | ||
@@ -118,0 +133,0 @@ |
26187
646