-
-
Save cjohansen/2638282 to your computer and use it in GitHub Desktop.
Graphite graph - Testing .size with done(function () { ... });
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
define([ | |
"src/graphite/graph", | |
"src/graphite/dictionary", | |
"src/graphite/query", | |
"src/graphite/utils", | |
"src/graphite/when" | |
], function (Graph, Dictionary, Query, Utils, When) { | |
buster.testCase("Graphite graph", { | |
... | |
"Function .size": function (done) { | |
var promises = []; | |
promises.push(this.g.size()); | |
this.g.addStatement(this.subJohn, this.preName, this.objJohnName); | |
promises.push(this.g.size()); | |
this.g.addStatement(this.subJohn, this.preKnows, this.subTim); | |
promises.push(this.g.size()); | |
this.g.addStatement(this.subJohn, this.preKnows, this.subTim); | |
promises.push(this.g.size()); | |
When.all(promises).then(done(function (results) { | |
assert.equals(results[0], 0); | |
assert.equals(results[1], 1); | |
assert.equals(results[2], 2); | |
assert.equals(results[3], 2); | |
})); | |
}, | |
... | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment