uci icon indicating copy to clipboard operation
uci copied to clipboard

Integrate with mocha and write tests

Open imor opened this issue 12 years ago • 8 comments

imor avatar Oct 10 '13 20:10 imor

How about Jasmine?

houd1ni avatar Nov 10 '15 08:11 houd1ni

Go ahead, I don't think I have a strong preference for mocha. Something is better than nothing.

imor avatar Nov 10 '15 17:11 imor

Do you want unit tests of actual JS functions, or e2e tests of actually running the code on some chess games?

valera-rozuvan avatar May 16 '18 00:05 valera-rozuvan

You can start with unit tests and later add integration tests with actual chess engines.

imor avatar May 16 '18 04:05 imor

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?

valera-rozuvan avatar May 17 '18 12:05 valera-rozuvan

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.

valera-rozuvan avatar May 17 '18 14:05 valera-rozuvan

Here is the initial PR https://github.com/imor/uci/pull/26 .

valera-rozuvan avatar May 17 '18 15:05 valera-rozuvan

Thanks 👍. Merged.

imor avatar May 18 '18 03:05 imor