code-reviews

athomasoriginal 2020-09-08T22:02:52.059300Z

Hi all! I usually add a https://gist.github.com/athomasoriginal/72119cf7fad645c4844bae866863d2b9#file-clj-L17 to improve my debug experience in cljs. I thought it would be an interesting exercise to write a test for the debug macro as well. https://gist.github.com/athomasoriginal/72119cf7fad645c4844bae866863d2b9. If anyone has any feedback that would be great! For example • I’m manually setting the console.log - maybe there is another way to do this? • Maybe the approach to testing this in general is flawed? (the idea for stubbing the console.log came from the with-log macro in clojure.tools.logging which I thought was pretty cool so as to not flood your tests /log files with logs) • What’s a good way of handling a macro where you need to access something stateful? (in this case I used an atom which we pass in) Thanks in advance!!