added JavaScript version of tests