Confirm results in response contain a filetype

Hi Guys, I’m brand new to Postman and brand new to coding so i am trying to teach myself on the fly as I start in my new job.

If I have a response to an APi request which looks like this :

    "results": [

What is the syntax for a test to confirm that there is a .clf file contained in the response.

I have tried this and a few different variations of it;;;

The clf part is the part I am having problems with.

Hey @markst33

Welcome to the community! :trophy:

You can use regex with the .to.match() chaiJS assertion to check that file extension:

pm.test("File Path Check", () => {

You can also check for different extensions using the same method like they have done here:

1 Like