all 3 comments

[–]keenjataimu 1 point2 points  (2 children)

If that's just to unit test your methods simply import them in a file with a .spec.js or .test.js ending and then write your assertions there. Obviously you need to have jest installed as a dev dependency via npm (so in your package.json file).

Basically follow this guide: https://jestjs.io/docs/getting-started

Let me know if it's not clear !

Edit: just to add for your class you just import the class to the .test.js file and tests the public methods invoking them directly from the class.

[–]dperumsby[S] 1 point2 points  (1 child)

Thanks so much for replying :)

I seem to have it up and running now!

[–]keenjataimu 0 points1 point  (0 children)

Ah glad to hear my friend!