-
Notifications
You must be signed in to change notification settings - Fork 26
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
Jest bolt receiver #24
Conversation
38c8551
to
94d45d1
Compare
94d45d1
to
171f7be
Compare
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.
looks mostly good, just some small changes and suggestions.
let app: MyApp; | ||
|
||
beforeEach(() => { | ||
receiver = new JestReceiver(); |
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 don't think you need to do this in the beforeEach
? Slows down the tests.
this works, I think, and will for most users?
describe('My Awesome App', () => {
const receiver = new JestReceiver();
let app: MyApp;
beforeEach(() => {
app = new App({ receiver, token: fields.token });
});
it('Can handle a slash command', async () => {
...
or you can just it in a before
instead of a beforeEach
if you want for setup. but ^ seems to work.
@@ -0,0 +1,80 @@ | |||
# Jest Bolt Receiver | |||
|
|||
A [receiver](https://slack.dev/bolt/concepts#receiver) built for testing Slack Bolt apps with Jest. This receiver allows you to easily send mock events to your app and write consistent tests. |
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.
Having a better description of what you had to do when testing before this package and after would help demonstrate the value more.
} | ||
|
||
// For things that fall under "Base Events" | ||
// https://github.com/slackapi/bolt/blob/1655999346077e9521722a667414758da856ede2/src/types/events/base-events.ts |
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 link to a specific tree/commit? why not https://github.com/slackapi/bolt/blob/master/src/types/events/base-events.ts ?
return event; | ||
} | ||
|
||
// For things that fall under "Base Events" |
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.
things?
Co-Authored-By: Nick Bartlett <nbartlett7@gmail.com>
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.
Related Issue
Supports #8
Related PRs
Depends #21
What does this PR do?
New Package! I present, a bolt receiver, made just for jest. What great tests will come of this.
Description of Changes
Bolt receiver, It's got jest spies in it. It's nice.
What gif most accurately describes how I feel towards this PR?