alfg / overwatch-api

:earth_americas: An Unofficial Overwatch HTTP API
https://owapi.io/docs/
MIT License
148 stars 27 forks source link

Add tests for stats and profile parser. #26

Closed alfg closed 7 years ago

alfg commented 7 years ago

Write AVA unit tests for the profile and stats parsers:

https://github.com/alfg/overwatch-api/blob/master/app/parser/profile.js https://github.com/alfg/overwatch-api/blob/master/app/parser/stats.js

vomitaftertaste commented 7 years ago

I like to take it if nobody else is working on it

alfg commented 7 years ago

@vomitaftertaste Go for it! :)

vomitaftertaste commented 7 years ago

@alfg how do you wanted the test to be written? Should I have a html file saved/hardcoded and then do some kind of stub for request-promise? Or you want it to just call overwatch server? so that the test will know if some html changes happens.

alfg commented 7 years ago

Lets try the second option. I think it'll be helpful in case the DOM changes to catch fixes.

Since the stats/profile can change over time, we can just test for the types and general data structure sent back.