Hello, I tried to clone this repository to work on adding the status feature.
But i cannot seem to get npm t
running.
This is the result
FAIL dist/createBot.test.js (37.59 s)
send functions
√ sends text (628 ms)
√ sends message (502 ms)
√ sends image (580 ms)
√ sends document (553 ms)
√ sends audio (610 ms)
√ sends video (522 ms)
√ sends sticker (654 ms)
√ sends location (517 ms)
√ sends template (589 ms)
√ sends contacts (508 ms)
√ sends reply button (612 ms)
√ sends list (540 ms)
server functions
√ invalid webhook token (37 ms)
× verify webhook token (3 ms)
√ send invalid body (16 ms)
× listen for new messages (30014 ms)
● server functions › verify webhook token
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
connect ECONNREFUSED 127.0.0.1:80
● server functions › listen for new messages
thrown: "Exceeded timeout of 30000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
265 |
266 | // eslint-disable-next-line no-async-promise-executor
> 267 | test('listen for new messages', (): Promise<void> => new Promise(async (resolve, reject) => {
| ^
268 | const payloads = [
269 | {
270 | from: '12345678',
at src/createBot.test.ts:267:3
at Object.<anonymous> (src/createBot.test.ts:194:1)
Test Suites: 1 failed, 1 total
Tests: 2 failed, 14 passed, 16 total
Snapshots: 0 total
Time: 37.783 s, estimated 39 s
Ran all test suites matching /dist/i.
I tried using various webhook_path but it seem to keep getting 403 (forbidden)
Here is my webhook path
WEBHOOK_PATH="http://localhost:3000/webhook/whatsapp"
I also tried manually using rest api
GET http://localhost:3000/webhook/whatsapp?hub.mode=subscribe&hub.challenge=random&hub.verify_token=41ESBjuy5E
But gets 403 Forbidden instead.
I am running on Windows 10.
I also want to know what WEBHOOK_PATH do you use?
question