Avoid using Array.prototype.indexOf in tests.