Skip to content

Commit 5c159e9

Browse files
committed
Added broken tests for filter functions.
1 parent 6e2691b commit 5c159e9

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

test/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ describe("Promisify", function() {
1818
assert(Array.isArray(promisify.callbacks));
1919
});
2020

21+
describe("node modules", function() {
22+
it("can be consumed", function() {
23+
var fs = promisify("fs");
24+
return fs.readFile(__dirname + "/../LICENSE");
25+
});
26+
});
27+
2128
describe("asynchronous method inference", function() {
2229
var later = function(cb) {
2330
setTimeout(cb(null), 0);
@@ -66,5 +73,29 @@ describe("Promisify", function() {
6673

6774
return obj.a();
6875
});
76+
77+
it("can identify an asynchronous function by filter function", function() {
78+
var obj = promisify({
79+
a: function a() { arguments[0](); }
80+
}, function(func) {
81+
return func.name === "a";
82+
});
83+
84+
return obj.a();
85+
});
86+
87+
it("can iterate over prototypes", function() {
88+
function Test() {}
89+
90+
Test.prototype = {
91+
a: function a() { arguments[0](); }
92+
};
93+
94+
promisify(Test, function(func, keyName, parentKeyName) {
95+
return func.name === "a";
96+
});
97+
98+
return new Test().a();
99+
});
69100
});
70101
});

0 commit comments

Comments
 (0)