Add unit test js for headless testing