Open cjwilburn opened 5 years ago
Grabbing this one, thanks!
Hello @GhostToast , I'm going to create a pull request integrating ava over the course of this day, just letting you know to avoid conflicts.
@stevefai thanks, i look forward to it. i've not used it yet so i'm muddling through so far. happy to help w/ any conflicts as they arrive.
@stevefai here is my initial progress, not working so far. but the test suite is installed. i think "make test" was a placeholder in the package.json file - but maybe there's another approach. in case this is useful to you (i've never used ava) - otherwise happy to wait for your example. it will be interesting to find ways to put assertions in some of these since most of it is console logging haha. probably will have to alter how some of the files operate, more subfunctions, etc. https://github.com/cjwilburn/dank-memes/compare/dankest-dungeon-tests?expand=1
@GhostToast this was just merged #62 , it should make testing a bit easier.
If you refactor dankest-dungeon.js
to use console-reader
instead, you can then replace calls to console-reader.question
with stubs while testing and everything should go smoothly.
For creating stubs, maybe we should use SinonJS. My pull request for this will come just tomorrow though.
At this point I've made no progress, mostly due to being busy. I'm unassigning this from myself in case someone else wants to give it a go cc @cjwilburn @stevefai
Thanks @GhostToast for the heads-up
Summary
Write unit tests for
dankest-dungeon.js
in ava