ether-camp / virtual-accelerator

17 stars 19 forks source link

Add tests for edge cases and add examples for fixing use of assert #7

Closed adklempner closed 1 week ago

adklempner commented 7 years ago

RE: adfb5cc "Replace assert with assert.equal where necessary"

Older tests were not using the assert() method correctly. Ex: https://github.com/ether-camp/virtual-accelerator/blob/5c5cc40dd065f6279138d44901ae0776ec6755d1/test/dst-management/requesting-funds-test-4.js#L304

assert(a, b) is not the same as assert.equal(a, b) The assert() function by itself simply returns whether the expression inside evaluates to true, it does not check for equality when it is passed two parameters.

When I replaced instances of assert() where there should be assert.equal(), it caused the test to fail, revealing that it was not checking for the correct value.

Ex: https://github.com/adklempner/virtual-accelerator/blob/adfb5cc4ad2201ab1c147c90f0e68c8f41692c85/test/dst-management/requesting-funds-test-5.js#L304