@@ -34,10 +34,22 @@ function versionNumber() {
3434const token = new Buffer ( "Y2Y5NDdhZDJhYzJlMzg1OGNiNzQzYzcwOWZhNGI0OTk2NWQ4ZDg3Yg==" , "base64" ) . toString ( )
3535const iconPath = join ( __dirname , ".." , "fixtures" , "test-app" , "build" , "icon.icns" )
3636
37- //test("GitHub unauthorized", async (t) => {
38- // t.throws(await new GitHubPublisher("github-releases-test", "test-repo", versionNumber(), "incorrect token")
39- // .releasePromise, /(Bad credentials|Unauthorized|API rate limit exceeded)/)
40- //})
37+ const publishContext : PublishContext = {
38+ cancellationToken : new CancellationToken ( ) ,
39+ progress : null ,
40+ }
41+
42+ test ( "GitHub unauthorized" , async ( ) => {
43+ try {
44+ await new GitHubPublisher ( publishContext , { provider : "github" , owner : "actperepo" , repo : "ecb2" , token : "incorrect token" } , versionNumber ( ) ) . releasePromise
45+ }
46+ catch ( e ) {
47+ expect ( e . message ) . toMatch ( / ( B a d c r e d e n t i a l s | U n a u t h o r i z e d | A P I r a t e l i m i t e x c e e d e d ) / )
48+ return
49+ }
50+
51+ throw new Error ( "must be error" )
52+ } )
4153
4254function isApiRateError ( e : Error ) : boolean {
4355 if ( e . name === "HttpError" ) {
@@ -65,11 +77,6 @@ function testAndIgnoreApiRate(name: string, testFunction: () => Promise<any>) {
6577 } )
6678}
6779
68- const publishContext : PublishContext = {
69- cancellationToken : new CancellationToken ( ) ,
70- progress : null ,
71- }
72-
7380test ( "Bintray upload" , async ( ) => {
7481 const version = versionNumber ( )
7582
0 commit comments