- Setup using @strapi/sdk-plugin with commands for
build
andwatch
. - An isolated Strapi instance for testing and development, the Playground.
- Github Actions workflow for linting and testing.
- Clear community files like CONTRIBUTING.md and CODE-OF-CONDUCT.md.
- Jest & Supertest for testing your plugin API's.
- Cypress for GUI e2e tests
This repository is meant to be a template for new plugins. It can be used as a starting point, giving you the resources to built a test-driven Strapi plugin.
After creating your copy of the template, do a find-replace through the code and change the following:
- Change
boilerplate
(lowercase) to be the identifier of your plugin. - Change
Boilerplate
(uppercase) to be the human readable name of your plugin.
You're all set! Go make your plugin and write some tests!
This repository has been made alongside an article series called "Automated Testing for Strapi Plugins". To better understand how and why this repository has been setup, please read the following articles:
- Using a Playground Instance
- Integration tests (In Progress)
- E2E tests (In Progress)
yarn build
- The native build command of
@strapi/sdk-plugin
. - Documentation can be found here.
yarn watch
- The native watch command of
@strapi/sdk-plugin
. - Documentation can be found here.
yarn watch:link
- The native watch:link command of
@strapi/sdk-plugin
. - Documentation can be found here.
yarn verify
- The native verify command of
@strapi/sdk-plugin
. - Documentation can be found here.
- Used in the linting step of the pipeline.
yarn test:ts:front
- A check for Typescript errors on the front-end side.
- Used in the linting step of the pipeline.
yarn test:ts:back
- A check for Typescript errors on the back-end side.
- Used in the linting step of the pipeline.
yarn playground:install
- Installs the plugin into the playground using
yalc-add-link
. - Installs all other dependencies of the playground.
yarn playground:yalc-add
- Installs a production-like version of the plugin, into the playground.
yarn playground:yalc-add-link
- Installs a development build of the plugin, into the playground.
yarn playground:build
- The native Strapi build command, ran in the playground.
- Documentation can be found here.
yarn playground:develop
- The native Strapi develop command, ran in the playground.
- Documentation can be found here.
yarn playground:start
- The native Strapi start command, ran in the playground.
- Documentation can be found here.