This is a simple utility for testing gobble plugins.
npm i -D gobble-test
(Note: these instructions are guidelines only. Feel free to adapt to your circumstances.)
In your plugin repo, create a
test directory. Inside that folder create two subdirectories -
expected - and an
index.js file, so that your plugin repo looks something like this:
gobble-myplugin|- test|- src|- expected|- index.js|- package.json|- index.js|- README.md
src directory, create some source files. In the
expected directory, create a directory of output files for each test. Your
index.js file should look something like this:
var gobble =test =path =myPlugin = ;;
node test from the root of your plugin repo. gobble-test will take each test in turn, build the definition to
gobble-test-result, and compare it with the contents of
expected. If they differ, it will abort the run of tests, leaving
gobble-test-result so that you can inspect it and figure out what went wrong.