Skip to content

Commit a9aeedf

Browse files
authored
add emoji test (#198)
1 parent 876c557 commit a9aeedf

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

β€Žtest/middleware.spec.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,10 @@ const getRecentReq = (): { body: Types.WebhookRequestBody } =>
1515
JSON.parse(readFileSync(join(__dirname, "helpers/request.json")).toString());
1616

1717
describe("middleware", () => {
18-
const http = (
19-
headers: any = {
20-
"X-Line-Signature": "jhKDdIeWwHj2SW6BIeHlUyePWOlfCcoGlyA1oFajRlQ=",
21-
},
22-
) =>
23-
new HTTPClient({
24-
baseURL: `http://localhost:${TEST_PORT}`,
25-
defaultHeaders: headers,
26-
});
27-
28-
before(() => listen(TEST_PORT, m));
29-
after(() => close());
30-
3118
const webhook: Types.MessageEvent = {
3219
message: {
3320
id: "test_event_message_id",
34-
text: "this is test message.",
21+
text: "this is test message.πŸ˜„πŸ˜…πŸ˜’πŸ˜žπŸ˜„πŸ˜…πŸ˜’πŸ˜ž",
3522
type: "text",
3623
},
3724
replyToken: "test_reply_token",
@@ -43,6 +30,18 @@ describe("middleware", () => {
4330
mode: "active",
4431
type: "message",
4532
};
33+
const webhookSignature = {
34+
"X-Line-Signature": "GzU7H3qOXDzDD6cNcS/9otLzlLFxnYYriz62rNu5BDE=",
35+
};
36+
37+
const http = (headers: any = { ...webhookSignature }) =>
38+
new HTTPClient({
39+
baseURL: `http://localhost:${TEST_PORT}`,
40+
defaultHeaders: headers,
41+
});
42+
43+
before(() => listen(TEST_PORT, m));
44+
after(() => close());
4645

4746
it("succeed", async () => {
4847
await http().post(`/webhook`, {

0 commit comments

Comments
Β (0)