How to unit test plugins during developoment?
-
If I'm developing a plugin for NodeBB, what is the recommended way to write unit tests for the plugin?
Has anyone done this who would like to share his workflow?
-
Do you mean you want to do integration testing? Running your plugin in a live NobeBB?
Unit tests would use a mocks (fake functions that always return expected results) to call nodebb and db methods.
-
I've had similar issues trying to meet things up with the style guide.
-
@yariplus Yes, integration testing especially. Is there any resource on how to do it with NodeBB and its plugins?
-
Not particularly... there's no exposure to the testing suite via plugins.
If you want to test the plugin via eslint, you can run it locally:
./node_modules/.bin/eslint .
Suggested Topics
Copyright © 2018 NodeBB | Contributors