Skip to content

Commit

Permalink
chore: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacicada committed Oct 16, 2023
1 parent 62ddd85 commit c0788a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ const aweber = new AweberClient({
refreshToken: import.meta.env.VITE_AWEBER_REFRESH_TOKEN,
})

it('should build the correct url', async () => {
expect(aweber._getURL('https://api.aweber.com/1.0/', 'https://aweber.com/1.0/')).toBe('https://api.aweber.com/1.0/')

expect(aweber._getURL('')).toBe(`https://api.aweber.com/1.0/accounts/${aweber.accountId}`)
})

// behold the magic of testing on live services!
it('should list all lists', async () => {
await expect(aweber.getLists({ start: 0, size: 1 })).resolves.toBeTypeOf('object')
Expand Down

0 comments on commit c0788a7

Please sign in to comment.