FormidableLabs / electron-webpack-dashboard

Electron Desktop GUI for Webpack Dashboard
http://formidable.com/blog/2017/introducing-electron-webpack-dashboard/
MIT License
2.71k stars 78 forks source link

Fixed format-versions when problem bundle does not contain the versions #55

Open maoueh opened 6 years ago

maoueh commented 6 years ago

It appears that it's possible the problem bundle received from webpack does not contain the versions data at all. This was not handled correctly in the formatVersions function.

Fixed the function to be more robust and added unit tests for it along the way. Unit tests for an existing case was added but really not sure if it's the right format as I never seen it :)

Note I disabled no-use-before-define in my unit test as I found it makes tests much more readable. Don't hesitate to disapprove and I'll revert the change.