postman-to-openapi icon indicating copy to clipboard operation
postman-to-openapi copied to clipboard

refactor: create folder when writing output

Open fzn0x opened this issue 3 years ago • 4 comments

This PR fix [Error: ENOENT: no such file or directory, open 'D:\Projects\postman-to-markdown\api\collection.yml'] when the folder is not exist.

fzn0x avatar Sep 08 '22 22:09 fzn0x

hi @fzn0x, first of all thanks for the PR but please add some test if you want the PR to be evaluated.

Thanks!

joolfe avatar Sep 17 '22 10:09 joolfe

hi @fzn0x, first of all thanks for the PR but please add some test if you want the PR to be evaluated.

Thanks!

Do you have any suggestion how can I write the tests for it? since it's a file I don't want how I write my tests hurt you in the future.

fzn0x avatar Sep 17 '22 11:09 fzn0x

Hi @fzn0x,

So just try to test a positive and negative test, to check that the file has been created you can use just existsSync method, have a look to the existing test to see some examples.

Best Regards.

joolfe avatar Sep 17 '22 11:09 joolfe

Hi @fzn0x,

So just a try to test a positive and negative test, to check that the file has been created you can use just existsSync method, have a look to the existing test to see some examples.

Best Regards.

Thanks for the quick response!

fzn0x avatar Sep 17 '22 11:09 fzn0x

Closed due to inactivity

joolfe avatar Nov 05 '22 14:11 joolfe

@joolfe hi we can close this for now, still quite busy irl, I will reach back later!

fzn0x avatar Nov 05 '22 19:11 fzn0x