Add throw error to JS test