@ JuanPablo's answer is on the right track (pun intended), but it will match any location with / anywhere.
You want to make sure that there is nothing after / using the end of the string char $ and that the characters preceding / are what you expect. Below is a quick and dirty example:
it('redirect to /', function(done){ request(app) .get('/fail_id') .expect('Location', /\.com\/$/, done); });
source share