oddsdk / ts-odd

An SDK for building apps with decentralized identity and storage.
https://odd.dev/
Apache License 2.0
179 stars 24 forks source link

ts-odd unit tests running in browsers #548

Open bdehaynin opened 1 year ago

bdehaynin commented 1 year ago

Summary

Problem

Unit tests are currently run in node only. They may unexpectedly fail in the browser.

Impact

We may miss some error cases.

Solution

Run unit tests in headless browsers using playwright-test.

bgins commented 1 year ago

A first step in the task was completed by updating the unit tests to use assert instead of expect: https://github.com/oddsdk/ts-odd/pull/541

In addition, packaging changes were needed in rs-wnfs to support both node and headless browsers at the simultaneously: https://github.com/wnfs-wg/rs-wnfs/pull/318

The ODD SDK needs a few other changes to align with this newer version of rs-wnfs. When that is complete, it should be possible to get the browser tests running.

icidasset commented 1 year ago

@bgins I just upgraded to the latest rs-wnfs with your wasm packaging changes on the next branch. PR that was merged recently: https://github.com/oddsdk/ts-odd/pull/536