-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
types(test): add a test to not mix up built-in node MessageEvent type…
… with Slack MessageEvent type (relates to #2020)
- Loading branch information
Filip Maj
committed
Sep 10, 2024
1 parent
beb0345
commit 1d696f9
Showing
4 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expectAssignable } from 'tsd'; | ||
import type { GenericMessageEvent, MessageDeletedEvent, MessageEvent } from '../../src/index'; | ||
|
||
const anyMessageEvent: GenericMessageEvent = { | ||
type: 'message', | ||
subtype: undefined, | ||
channel_type: 'channel', | ||
channel: 'C1234', | ||
event_ts: '1234.56', | ||
user: 'U1234', | ||
ts: '1234.56', | ||
}; | ||
// don't confuse `MessageEvent` with the built-in node Message event (https://github.com/slackapi/node-slack-sdk/issues/2020) | ||
const messageDeletedEvent: MessageDeletedEvent = { | ||
type: 'message', | ||
subtype: 'message_deleted', | ||
event_ts: '1234.56', | ||
hidden: true, | ||
channel: 'C12345', | ||
channel_type: 'channel', | ||
ts: '1234.56', | ||
deleted_ts: '1234.56', | ||
previous_message: anyMessageEvent, | ||
}; | ||
expectAssignable<MessageEvent>(messageDeletedEvent.previous_message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters