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!
Mocha
There is one post filed in Mocha.