|
|
|
|
|
by vbezhenar
4077 days ago
|
|
The great value of unit testing is reproducibility. You can't always find the cause of the bug just from failed test logs. You might need to re-run the test to debug and tweak the code. And if your test is randomly failing, it would be quite tricky to do that. Randomness is OK. Just make sure that RNG yields the same values each time test run. For example in Java the class Random is guaranteed to yield the same values for the same seed. I'm not sure that JavaScript has this class, probably you'll have to write your own version or find it in some library. |
|