aleeusgr / gimbalabs-dandelion-pbl

Test Driven Development of dApps on Cardano
MIT License
1 stars 1 forks source link

Write tests #10

Closed aleeusgr closed 1 year ago

aleeusgr commented 1 year ago

How to write a testing suite for this application?

  1. Most straightforward way is to write a shell script, iterate over jsons and send each via curl, compare outputs to one verified by hand.
  2. Use Haskell testing tools: Hunit, Tasty, QuickCheck - for automation and efficiency
  3. Code coverage

https://github.com/input-output-hk/Developer-Experience-working-group/discussions/41

aleeusgr commented 1 year ago

https://www.youtube.com/watch?v=dcEhpPob-wM

aleeusgr commented 1 year ago

Unit testing:

See: https://github.com/SIDANWhatever/plutus-cborhex-automation/issues/27

what Spock does can be abstracted as a function. Ideally, it does not matter framewhat work you are using, a unit test is a request to the endpoint that contains correct data. The output of the function is compared to the set of expected outputs, it could be a file containing a json file.

todo: 
aleeusgr commented 1 year ago

Integration tests:

aleeusgr commented 1 year ago

A test with IO; File -> Bool https://github.com/aleeusgr/aoc/pull/2

What it tests for? How does it break? ghc, file is missing, ...