1

I'm writing tests on Postman queries and I'm wondering if there were wildcards to test for equality on a string?

example :

pm.test("projectSheet should includes ", function () {

    var jsonData = pm.response.json();

    // jsonData.projectSheet === like "projectFile.pdf"
    pm.expect(jsonData.projectSheet).to.eql("[*wildcard here*]projectFile.pdf");

});

Thanks for your answers !

louisBrochet
  • 11
  • 1
  • 3

1 Answers1

2

You could use a regular expression: pm.expect(jsonData.projectSheet).to.match(/.*projectFile\.pdf/)

Christian Baumann
  • 3,188
  • 3
  • 20
  • 37