using javascript version of QuickCheck for testing