adds tests for js implementation