postmanlabs / postman-collection

Javascript module that allows a developer to work with Postman Collections

Home Page:https://www.postmanlabs.com/postman-collection/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

collection script cannot be referenced in item

luiscarlosjayk opened this issue · comments

Documentation says that you can define an event at Collection level and you can then reference it in an item, helping not duplicating (DRY).
Seems there's an error on this feature.

You can replicate the error by trying to run the example in:
https://github.com/postmanlabs/postman-collection/blob/develop/examples/collection-v2.json

You will see an error in terminal like this:

→ 200 ok
  GET http://echo.getpostman.com/status/200 [200 OK, 205B, 245ms]
  1⠄ ReferenceError in test-script

→ 200 ok
  POST http://echo.getpostman.com/post [200 OK, 205B, 96ms]
  2⠄ ReferenceError in test-script

If you manually copy/paste the event in each item then error doesn't happen.