Change spec to javascript