Fix JavaScript unit tests