dev grind

The other night I ported some node code to a small web-page.
I showed it off the next day to a friend, and after I hit SEND I though... why are the commit dates from 5 months ago?

I had re-invented my own wheel.

Re-ported it.

Anyway. It meant I was working on the project again, so that's good. I added all the new things I had introduced into the original project, and pushed it over to, finally, as well:

Linting the code for the browser. ("Helloooo, EsLint!"). Cleaning it up. Adding some functionality.

TODO: unit-testing the browser-based JS.

I haven't done this consistently.

I've unit-tested Node, but not the browser, outside of one-off code chunks for a few things.

So. High time I take care of this.

I've used vows in the past, but will try working with Mocha

sample html-harness

This is pretty much based on the the one in this tutorial, but with some more annotations, and the mocha and chai dependencies pulled from a cdn instead of being local in the repo.

<!DOCTYPE html>
  <meta charset="utf-8">
  <title>mispelr tests</title>
  <link href="" rel="stylesheet" />
  <div id="mocha"><p><a href=".">Index</a></p></div>
  <div id="messages"></div>
  <div id="fixtures"></div>

  <!-- test framework -->
  <script src=""></script>
  <script src=""></script>

  <!-- scripts under test -->
  <script src="../js/maledict.js"></script>
  <script src="../js/lexer.js"></script>
  <script src="../js/mispel.js"></script>
  <!-- end scripts-under-test -->


  <!-- test scripts -->
  <script src="mispelr_test.js"></script>

  <!-- end test scripts -->