Comparing version 0.1.2 to 0.1.3
11
index.js
@@ -164,12 +164,5 @@ | ||
var promise = pinkySwear(); | ||
return this.once('value', function() {}) | ||
.then(ok || null, fail || null); | ||
this._ref.once('value', function(snap) { | ||
promise(true, snap); | ||
}, function(err) { | ||
promise(false, err); | ||
}); | ||
return promise; | ||
}; | ||
@@ -176,0 +169,0 @@ |
{ | ||
"name": "fireproof", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Promises for Firebase objects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,2 +38,21 @@ | ||
describe('#then', function() { | ||
before(function() { | ||
return fireproof.child('thentest').set(true); | ||
}); | ||
it('hands back a snapshot of the ref by default', function(done) { | ||
fireproof.child('thentest').then(function(snap) { | ||
console.log('got the result!'); | ||
expect(snap.val()).to.equal(true); | ||
done(); | ||
}, function() { | ||
console.log('got an error!'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('#child', function() { | ||
@@ -40,0 +59,0 @@ |
26605
666