Assuming that the contents of the Array are genuine element nodes, then it would be easier to simply use Array.prototype.filter() and Element.matches():
var items = Array.from(document.querySelectorAll('tr')),
test = items.filter(row => row.matches('tr.test'));
console.log(test);
<table>
<tbody>
<tr class="colour"></tr>
<tr class="colour"></tr>
<tr class="colour"></tr>
<tr class="test"></tr>
</tbody>
</table>
The above snippet uses the (new-ish) Arrow function syntax, which is equivalent to the following:
var items = Array.from(document.querySelectorAll('tr')),
test = items.filter(function(row){
return row.matches('tr.test');
});
console.log(test);
<table>
<tbody>
<tr class="colour"></tr>
<tr class="colour"></tr>
<tr class="colour"></tr>
<tr class="test"></tr>
</tbody>
</table>
Element.matches() tests the element (Element) against a supplied CSS selector and, if that supplied selector would match the Element, returns a Boolean true, otherwise false.
Array.from() converts the results of the Array-like collection returned from document.querySelectorAll() into an Array, in order to use Array methods, such as Array.prototype.filter(), which retains those elements in the Array for which the supplied assessment returns true/truthy values.
References:
$(info).filter(".name:first")?