File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,23 @@ class User extends Requestable {
132
132
return this . _requestAllPages ( this . __getScopedUrl ( 'starred' ) , requestOptions , cb ) ;
133
133
}
134
134
135
+ /**
136
+ * Gets the list of starred gists for the user
137
+ * @see https://developer.github.com/v3/gists/#list-starred-gists
138
+ * @param {Object } [options={}] - any options to refine the search
139
+ * @param {Requestable.callback } [cb] - will receive the list of gists
140
+ * @return {Promise } - the promise for the http request
141
+ */
142
+ listStarredGists ( options , cb ) {
143
+ options = options || { } ;
144
+ if ( typeof options === 'function' ) {
145
+ cb = options ;
146
+ options = { } ;
147
+ }
148
+ options . since = this . _dateToISO ( options . since ) ;
149
+ return this . _request ( 'GET' , '/gists/starred' , options , cb ) ;
150
+ }
151
+
135
152
/**
136
153
* List email addresses for a user
137
154
* @see https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user
Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ describe('User', function() {
61
61
user . listStarredRepos ( assertArray ( done ) ) ;
62
62
} ) ;
63
63
64
+ it ( 'should show user\'s starred gists' , function ( done ) {
65
+ const option = {
66
+ since : '2015-01-01T00:00:00Z' ,
67
+ } ;
68
+ user . listStarredGists ( option , assertArray ( done ) ) ;
69
+ } ) ;
70
+
64
71
it ( 'should follow user' , function ( done ) {
65
72
user . follow ( 'ingalls' , assertSuccessful ( done ) ) ;
66
73
} ) ;
You can’t perform that action at this time.
0 commit comments