File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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} ) ;
You can’t perform that action at this time.
0 commit comments