eykrehbein / strest

⚡️ CI-ready tests for REST APIs configured in YAML
MIT License
1.74k stars 59 forks source link

Filename() #95

Closed jgroom33 closed 5 years ago

jgroom33 commented 6 years ago

Assume the filename is postman-echo.strest.yml

Access the filename in the request:

version: 1                            # only version at the moment

requests:                             # all test requests will be listed here
  testRequest:                        # name the request however you want
    url: https://Filename().com/get  # required
    method: GET                       # required
jgroom33 commented 6 years ago

If you want to implement this, here's what roughly needs to be modified: add a regex: https://github.com/eykrehbein/strest/blob/master/src/test.ts#L186 testObject.relativePath has the filename in it. This would also need to be passed to the computeRequestObject method (possibly just add it to the val obj)

add test in tests/success/Filename

jgroom33 commented 5 years ago

124