matt-ball / postman-local

A client to facilitate local development of scripts for Postman.
Apache License 2.0
70 stars 6 forks source link

Issues when syncing the changes #22

Closed wmedali closed 4 years ago

wmedali commented 4 years ago

Steps to reproduce :

  1. create collection with a request with a simple console.log('bla bla') in pre-request script and test script
  2. run pm setup (with default options for directory and filenames)
  3. run pm bootstrap
  4. access pre-request and test script of one of the request and change the string in the console.log()
  5. runpm sync command (the collection file is created succers
  6. run pm update ( Postman updated! message displayed)
  7. go to Postman GUI and open pre-request script of the request

Current behavior : image

Expected behavior :

Find the change I made on prerequest.js in pre-request script in Postman GUI

Environment : Windows 10 postman-cli : v7.20.1 node : v10.16.2 npm : 6.9.0 VS Code : 1.43.1

Do not hesitate if you need more details to reproduce/fix the issue

matt-ball commented 4 years ago

Thanks for filing an issue!

For step 4, what did you change the log to? I'm guessing you're providing a random example, but if you intended to go from 'bla bla' -> 'walo walo wlao', I can see the change fed through in your screenshot. I can't reproduce currently but am observing an issue with a null directory being created which will be resolved in next release.

wmedali commented 4 years ago

Hello @matt-ball what you mentioned is exactly what I changed and you are right about the null directory I've remarked that as well (but forgot to fill an issue for it :( ) The change is synced and the request is successfully run. It is the amount of generated code that makes the scripts unreadable in Postman GUI that causes the problem. Unfortunate you can't reproduce it. Let's wait to see if other fellas running into this issue.

matt-ball commented 4 years ago

Got it - so if you look at line 2 of your screenshot, the change came through.

Because the CLI is all about viewing and editing your scripts locally - there is some extra bundled code that will appear in Postman only. There is currently a decision to be made - using the CLI workflow, or continuing to edit your scripts in Postman. It's difficult to enable the best of both worlds right now. The extra code you're seeing is what enables being able to require local files and other packages on npm.

So things are working as expected - that additional bundled code is something I want to tidy up https://github.com/matt-ball/postman-cli/issues/12 so doesn't inhibit usage from a local perspective.

The null issue has been fixed if you update to 0.0.25 😄

wmedali commented 4 years ago

Got it, thanks for clarification ! It's maybe worth it to add a little note in the README as the behavior is not really obvious from a user perspective.

I updated the package and the null directory fix seems working good 👍

matt-ball commented 4 years ago

That's a good point - I will include that shortly! Thanks for trying it out - I'll close this issue out, but if you have any other issues then feel free to open another!

matt-ball commented 4 years ago

README updated in #25