This week, I spent some time working to understand how to use the Mocha testing tool and the Chai assertion tool in developing apps using Node.js. I found two articles that I was going to use to get started, and I decided to set up my package.json file to use the latest version of the tools. What I found was that I could not use the example code in the two articles, and kept getting error messages that I could not find answers for, except that several people recommended using an older version of the Chai assertion tool. I took a look at the Chai website releases page, and found that in version 5, only ECMAScript Modules were supported. Previously, ECMAScript Modules and CommonJS Modules were allowed. However, this change meant that I would have to change the example code I was using to run the latest version of Chai. I tried numerous combinations of changes, but none were totally successful. After an hour of trial and error, I decided to reinstall version 4.3.7 of Chai in my test project, and everything now worked as I expected. UGH! Onward!
Software Testing
There are 3 posts filed in Software Testing (this is page 1 of 1).
While looking for some testing resources, I found a nice introduction to test-driven development by James Shore. His Github repo contains a test environment for Node.js and Javascript, but I think the key feature are the five videos linked from the repo. Also, they are part of a larger video site that used to be a subscription site, but is now free to all. Awesome!
I-Programmer: Review of “Software Testing Strategies” by Matthew Heusser and Michael Larsen.