waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
168 stars 42 forks source link

Add interoperability tests with nwaku to browser suite #887

Open fryorcraken opened 2 years ago

fryorcraken commented 2 years ago

This is a change request/

Problem

Interoperability tests are only executed in NodeJS because we setup the nwaku node as part of the test. This is not possible in the browser as the browser cannot start a process etc,

This means some bugs: https://github.com/status-im/js-waku/issues/886 can only be found once we manually test js-waku in an example, against a nwaku fleet.

Proposed Solutions

Do some interop test in the browser.

The current NodeJS strategy is unlikely to work (start nwaku node in beforeEach hooks) so we may need to use a different approach:

  1. Start a local fleet of nwaku nodes first
  2. Set node connection details in a global variable
  3. Use these nodes to run the test, possible using dynamic content topic to avoid test clashing

This may actually result in the test suite running faster as it means nwaku nodes are re-used and started in parallel.

Investigating execute some beforeEach like hook with karma framework might make sense too but should be time boxed.

fryorcraken commented 1 year ago

Note #1192