Skip to content

Commit e129047

Browse files
committed
fix: update error type
1 parent 78d0aa9 commit e129047

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎tests/email/emailApi.test.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FetchError } from '../../src/internal';
12
import { EmailAPI } from '../../src/lib/email';
23
import { JunoValidationError } from '../../src/lib/errors';
34

@@ -27,7 +28,7 @@ describe('sendEmail validation tests', () => {
2728
],
2829
});
2930
})()
30-
).rejects.toThrow(TypeError); // TypeError from lack of apiKey
31+
).rejects.toThrow(FetchError); // FetchError from lack of apiKey
3132
});
3233

3334
it('does not throw an validation error with a recipient', async () => {
@@ -55,7 +56,7 @@ describe('sendEmail validation tests', () => {
5556
],
5657
});
5758
})()
58-
).rejects.toThrow(TypeError); // TypeError from lack of apiKey
59+
).rejects.toThrow(FetchError); // FetchError from lack of apiKey
5960
});
6061

6162
it('does not throw an validation error with a recipient', async () => {
@@ -81,7 +82,7 @@ describe('sendEmail validation tests', () => {
8182
],
8283
});
8384
})()
84-
).rejects.toThrow(TypeError); // TypeError from lack of apiKey
85+
).rejects.toThrow(FetchError); // FetchError from lack of apiKey
8586
});
8687

8788
it('throws an validation error with no recipient, cc, or bcc', async () => {
@@ -163,7 +164,7 @@ describe('sendEmail validation tests', () => {
163164
],
164165
});
165166
})()
166-
).rejects.toThrow(TypeError); // TypeError from lack of apiKey
167+
).rejects.toThrow(FetchError); // FetchError from lack of apiKey
167168
});
168169

169170
it('does not throw a validation error with only bcc', async () => {
@@ -189,7 +190,7 @@ describe('sendEmail validation tests', () => {
189190
],
190191
});
191192
})()
192-
).rejects.toThrow(TypeError); // TypeError from lack of apiKey
193+
).rejects.toThrow(FetchError); // FetchError from lack of apiKey
193194
});
194195
});
195196

@@ -291,7 +292,7 @@ describe('Registering sender test validation tests', () => {
291292
country: 'country',
292293
});
293294
})()
294-
).rejects.toThrow(TypeError); // TypeError from lack of apiKey
295+
).rejects.toThrow(FetchError); // FetchError from lack of apiKey
295296
});
296297
});
297298

0 commit comments

Comments
 (0)