Skip to content

Commit

Permalink
chore: setup jest & supertest testing
Browse files Browse the repository at this point in the history
  • Loading branch information
boazpoolman committed Jan 13, 2025
1 parent 53dc177 commit abd5e0f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,35 @@ To better understand how and why this repository has been setup, please read the
4. `yarn verify`
- The native verify command of `@strapi/sdk-plugin`.
- [Documentation can be found here](https://docs.strapi.io/dev-docs/plugins/development/plugin-sdk).
- Used in the linting step of the pipeline.
- Used in the lint step of the pipeline.

### Testing commands

5. `yarn test:ts:front`
- A check for Typescript errors on the front-end side.
- Used in the linting step of the pipeline.
- Used in the lint step of the pipeline.
6. `yarn test:ts:back`
- A check for Typescript errors on the back-end side.
- Used in the linting step of the pipeline.
- Used in the lint step of the pipeline.
7. `yarn test:jest`
- Runs the jest tests. Can contain unit & integration tests.
- Used in the test step of the pipeline.

### Playground commands

7. `yarn playground:install`
8. `yarn playground:install`
- Installs the plugin into the playground using `yalc-add-link`.
- Installs all other dependencies of the playground.
8. `yarn playground:yalc-add`
9. `yarn playground:yalc-add`
- Installs a production-like version of the plugin, into the playground.
9. `yarn playground:yalc-add-link`
10. `yarn playground:yalc-add-link`
- Installs a development build of the plugin, into the playground.
10. `yarn playground:build`
11. `yarn playground:build`
- The native Strapi build command, ran in the playground.
- [Documentation can be found here](https://docs.strapi.io/dev-docs/cli).
11. `yarn playground:develop`
12. `yarn playground:develop`
- The native Strapi develop command, ran in the playground.
- [Documentation can be found here](https://docs.strapi.io/dev-docs/cli).
12. `yarn playground:start`
13. `yarn playground:start`
- The native Strapi start command, ran in the playground.
- [Documentation can be found here](https://docs.strapi.io/dev-docs/cli).
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
testEnvironment: "node",
testPathIgnorePatterns: [
"/node_modules/",
".tmp",
".cache"
]
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"verify": "strapi-plugin verify",
"test:ts:front": "tsc -p admin/tsconfig.json",
"test:ts:back": "tsc -p server/tsconfig.json",
"test:jest": "jest --verbose --runInBand --forceExit",
"playground:install": "yarn playground:yalc-add-link && cd playground && yarn install",
"playground:yalc-add": "cd playground && yalc add strapi-plugin-boilerplate",
"playground:yalc-add-link": "cd playground && yalc add --link strapi-plugin-boilerplate",
Expand All @@ -47,9 +48,11 @@
"@strapi/typescript-utils": "^5.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"jest": "^29.7.0",
"prettier": "^3.4.2",
"react": "^19.0.0",
"react-router-dom": "^6.0.0",
"supertest": "^7.0.0",
"typescript": "^5.7.2"
},
"peerDependencies": {
Expand Down

0 comments on commit abd5e0f

Please sign in to comment.