-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests #2
add tests #2
Conversation
index.test.ts
Outdated
vi.mocked(login).mockRejectedValue('mocked bluesky.login()') | ||
}) | ||
test('throws', async () => { | ||
await expect(() => handlePayload(payload)).rejects.toThrow('mocked bluesky.login()') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the exception message saying it's mocked rather than invalid? I know during this test it is mocked but in a general sense it's invalid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handlePayload
will re-throw any errors it receives, so that the AWS logs show what went wrong... I can clarify this a bit though
}) | ||
test('does _not_ post the song title', async () => { | ||
await handlePayload(payload) | ||
expect(mockedPost).not.toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love that we do this to avoid double posting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we accidentally add a new song and then remove it (maybe it turns out to just be a tease or jam), if we'd be able to retroactively delete the associated post. This isn't really relevant to this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we accidentally add a new song and then remove it (maybe it turns out to just be a tease or jam), if we'd be able to retroactively delete the associated post. This isn't really relevant to this PR though.
hmmm yeah that's a bit tricky at this point... would be a sweet add-on though
CHANGELOG
file[fixes #1]