TrueBitFoundation / incentive-layer

[DEPRECATED] Incentive layer contracts and deployment information.
31 stars 20 forks source link

Better client testing #62

Closed hswick closed 6 years ago

hswick commented 6 years ago

Some basic features have been implemented for client.

The setup and tear down has also been implemented in test/client.js

The next steps are to test each state change for clients. This is a bit tricky because any blockchain client code uses side effects which are hard to test. Also the client does wait for each test to complete it keeps continuing with its process.

The test/client.js file has a list of todos that can guide with this. Specifically the tests need to behave a lot like incentive_layer.js tests

I think the best way to test this would be to generate a list of the relevant events and do two things:

  1. Ensure they are in the proper order
  2. Ensure that each event contains the correct data