Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Postman giving the error “TypeError: e.exec is not a function” [duplicate]

Tags:

postman

I am trying to check if a string exists with

pm.expect(jsonData[0]["name"]).to.match('abagnale');

but I am getting

 TypeError: e.exec is not a function
like image 302
Michael Durrant Avatar asked Apr 13 '26 08:04

Michael Durrant


1 Answers

Use a regex expression instead of a string

The error message is a little generic but in this case it can be fixed by using a regex

to.match(/abagnale/)

instead of a string

to.match('abagnale')
like image 178
Michael Durrant Avatar answered Apr 18 '26 17:04

Michael Durrant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!