JavaScript Unit Testing with Jasmine
So I built a fairly involved single-page JavaScript / HTML app that generates litigation calendar events using some convoluted logic (calculating holidays, when those holidays are observed (e.g., if November 11th falls on a Saturday, Veterans Day is observed on the preceding Friday, but if it falls on a Sunday, it's observed the next Monday - CRC 1.11 ), etc. It’s large, and important, enough, I finally sat down and learned how to build Jasmine unit tests for JavaScript. My code may be spaghetti (I never really sat down to learn JavaScript, and kind of winged it with ES6 for this app), but at least it will be validated spaghetti. I have a book, JavaScript Unit Testing , that covers Jasmine 1.2, so I’m using the ancient 1.3.1-standalone version here. It works, for now (I’ll learn the new stuff as I have time). src/testCode.js The code being tested. This is a silly, simple example: function returnsTrue() { return true; } spec/testCodeSpec.js A “suite” is a group of te