Edittodo list in node.js and geektool
I’ve long had a quick shell script that was a simple todo list based on Jerod Santo’s Minimally Awesome Todos. It’s very minimal, and quite awesome indeed. Even more than loving how minimal it is, I really liked displaying my todos on my desktop through GeekTool.
Then I stumbled onto a Node.js version of a todo list and thought I’d give it a shot. I got it setup, but when I wanted to try to display the output through GeekTool, I failed. So I delved into todo list code a bit more and learned quite a lot!
My first attempt was to simply write the output of the
todo ls command to a file. I got an immediate response from the maintainer, Veselin Todorov and was encouraged to change the command from
export and write up a test for the new command as well.
I succeeded in converting the
write command to
export, and fixed up a small bug with the path of the file I was writing to by default, but thus far have completely failed at writing a test to confirm that the file was written.
The project is currently using Sinon.JS for testing, and even though the API seems pretty robust, and the examples coherent, I’m simply failing at figuring out how to test file creation with it. So far all I have is a stub:
However, it is working well without a test at this point, and I have a pretty todo list on my desktop! :)