Chapter 7. Test, package, and document your plugin
This chapter covers
- Testing your plugin
- Packaging your plugin for distribution
- Documenting and demonstrating your plugin
Once you’ve written your new plugin, you probably want to make it available to the wider jQuery community. To give it the best chance of competing with other plugins that provide similar functionality, you should ensure that it works as expected in all situations. Using a testing suite such as QUnit lets you create a series of repeatable tests for a wide range of scenarios for your plugin, in the familiar environment of a web browser.
You should also provide potential users with a package that includes everything they need to implement your plugin. As well as the plugin code itself, you may need to include associated stylesheets, images, localizations, and perhaps even a simple demonstration page. To reduce network requirements when the plugin is being used, it’s also helpful to include a minimized version of your plugin code, as provided by one of several online packing tools. All of the related files are then collected into a single archive file for ease of distribution.