this repo has no description
1import {
2 CloseFn,
3 runTestServer,
4 TestServerInfo,
5} from '@atproto/pds/tests/_util'
6import { AtpAgent, ComAtprotoServerCreateAccount } from '..'
7
8describe('errors', () => {
9 let server: TestServerInfo
10 let client: AtpAgent
11 let close: CloseFn
12
13 beforeAll(async () => {
14 server = await runTestServer({
15 dbPostgresSchema: 'known_errors',
16 })
17 client = new AtpAgent({ service: server.url })
18 close = server.close
19 })
20
21 afterAll(async () => {
22 await close()
23 })
24
25 it('constructs the correct error instance', async () => {
26 const res = client.api.com.atproto.server.createAccount({
27 handle: 'admin.blah',
28 email: 'admin@test.com',
29 password: 'password',
30 })
31 await expect(res).rejects.toThrow(
32 ComAtprotoServerCreateAccount.UnsupportedDomainError,
33 )
34 })
35})