improved js unit tests