Skip to content

Commit 537b5f9

Browse files
test
1 parent cb4c069 commit 537b5f9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/cli/src/__tests__/unit/runtime/config-fetcher.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff 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 () => {

0 commit comments

Comments
 (0)