File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
packages/cli/src/__tests__/unit/runtime Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,23 @@ describe('fetchConfig', () => {
6767 ) ;
6868 } ) ;
6969
70- it ( 'throws on 401' , async ( ) => {
70+ it ( 'throws RunnerAuthError on 401' , async ( ) => {
71+ const { RunnerAuthError } =
72+ await import ( '../../../runtime/runner-auth-error.js' ) ;
7173 mockFetch . mockResolvedValueOnce ( {
7274 ok : false ,
7375 status : 401 ,
7476 statusText : 'Unauthorized' ,
77+ headers : new Headers ( ) ,
78+ clone ( ) {
79+ return {
80+ status : 401 ,
81+ statusText : 'Unauthorized' ,
82+ json : async ( ) => ( { } ) ,
83+ } ;
84+ } ,
7585 } ) ;
76- await expect ( fetchConfig ( opts ) ) . rejects . toThrow (
77- 'Config fetch failed (401)' ,
78- ) ;
86+ await expect ( fetchConfig ( opts ) ) . rejects . toBeInstanceOf ( RunnerAuthError ) ;
7987 } ) ;
8088
8189 it ( 'does not send If-None-Match when no lastEtag' , async ( ) => {
You can’t perform that action at this time.
0 commit comments