I would imagine you would add what @baris mentioned in here:
https://github.com/bubundas17/nodebb-plugin-hide-contents/blob/master/library.js#L19
if user is member of the poster set, return content as is
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 .