Javascript tests for two utils functions