whatsapp-web.js/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Pedro S. Lopez f149516d0d
chore(tests): add Chat model tests (#784)
* add search and status tests

* reset to previous status in test

* move version to its own test

* add tests for Chat model

* keep hooks at the top

* run tests recursively in default script
2022-02-05 22:05:42 -04:00
..
structures chore(tests): add Chat model tests (#784) 2022-02-05 22:05:42 -04:00
client.js chore(tests): add Chat model tests (#784) 2022-02-05 22:05:42 -04:00
helper.js Add tests and detect WhatsApp Web updates (#686) 2021-07-16 02:50:05 -04:00
README.md Update README.md 2021-07-16 02:53:39 -04:00

Running tests

These tests require an authenticated WhatsApp Web session, as well as an additional phone that you can send messages to.

This can be configured using the following environment variables:

  • WWEBJS_TEST_SESSION: A JSON-formatted string with the session details. Must include WABrowserId, WASecretBundle, WAToken1 and WAToken2.
  • WWEBJS_TEST_SESSION_PATH: Path to a JSON file that contains the session details. Must include WABrowserId, WASecretBundle, WAToken1 and WAToken2.
  • WWEBJS_TEST_REMOTE_ID: A valid WhatsApp ID that you can send messages to, e.g. 123456789@c.us. It should be different from the ID used by the provided session.

You must set WWEBJS_TEST_REMOTE_ID and either WWEBJS_TEST_SESSION or WWEBJS_TEST_SESSION_PATH for the tests to run properly.