Integrate with mocha and write tests
How about Jasmine?
Go ahead, I don't think I have a strong preference for mocha. Something is better than nothing.
Do you want unit tests of actual JS functions, or e2e tests of actually running the code on some chess games?
You can start with unit tests and later add integration tests with actual chess engines.
I am writing JS unit tests, and running them using karma. Karma requires a recent Node.js version. From their docs:
Karma currently works on Node.js 4.x, 5.x, 6.x, 7.x, and 8.x. See FAQ for more info.
Are you OK with bumping engines.node to >=4.0 in package.json?
I decided to just use mocha :smile: But it also requires Node v4 or higher. See their docs:
To install Mocha v3.0.0 or newer with npm, you will need npm v2.14.2 or newer.
Additionally, to run Mocha, you will need Node.js v4 or newer.
Here is the initial PR https://github.com/imor/uci/pull/26 .
Thanks 👍. Merged.