Out of the box, ChaiJS provides the satisfy
keyword which is followed by a predicate.
The predicate can use any Javascript expression, so for example using String.prototype.endsWith()
cy.get('.my_class')
.find('a')
.should('have.attr', 'href')
.and('satisfy', href => href.endsWith('/' + test_id))