Fix Testing Suite to Work Out of the Box #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Testing Suite to Work Out of the Box and Add GitHub Workflow
This PR addresses issues with the testing suite to ensure it works correctly out of the box for the Payload CMS plugin template. It also adds a GitHub workflow to automatically run tests.
Changes
Updated Dependencies
@payloadcms/plugin-cloudfrom^2.0.0to^3.0.2dotenvfrom^8.2.0to^16.4.5payloadfrom^2.0.0to^2.27.0mongodb-memory-serverversion^10.0.0nodemonfrom^2.0.6to^3.1.4ts-nodefrom^9.1.1to^10.9.2Testing Configuration
jest.config.jsto use@swc/jestfor transformationplugin.spec.tsto improve test setup and teardown:beforeAllhook to 30 secondsafterAllhook to 10 secondsBuild and Development Scripts
payload.config.tsto import the plugin from thedistdirectory instead ofsrcserver.tsto return a Promise resolving to the server instance, allowing for better test controlAdded GitHub Workflow
.github/workflows/test.ymlto run tests automatically:Other Improvements
dev/package.jsonscript with"test": "jest --forceExit --detectOpenHandles"Testing
The new GitHub workflow will automatically run tests on push and pull requests. You can also verify that the testing suite works correctly locally by running:
All tests should pass without any configuration issues.