Convert spec-helper to JavaScript