ScaffoldHub
  • Introduction
  • Modeling
  • Setup
    • NextJS
    • File Storage
    • Payments with Stripe
  • Debugging
  • End-to-end and Unit Tests
  • Deployment
    • Deploy to Vercel
  • Features
    • Projects
    • Preview
    • Tenants
    • Subscriptions and Payments
    • Security
    • File Storage
    • Authentication
      • Sign-in and Sign-up and Social Sign-in
      • Invitation
      • Password Reset
      • Password Change
      • Email Verification
    • Entity
      • Form
      • Filter and List
      • Export
      • Import
    • Audit Logs
    • Internationalization (I18n)
    • API Keys
    • API Documentation
  • Package.json
  • Support
  • Changelog
    • Documentation
    • Scaffolds
  • Custom Development
  • Legacy Scaffolds
  • Go to ScaffoldHub
Powered by GitBook
On this page
  • End-to-end Tests using Playwright
  • Backend tests using Jest

End-to-end and Unit Tests

PreviousDebuggingNextDeployment

Last updated 1 year ago

Before you run any test - end-to-end or backend - you need to configure the .env.test file.

For safety reasons, the database is not pre-configured there, but you can uncomment the suggested database settings.

The database gets erased on every test scenario! So be careful and use a disposable database.

All the pre-defined features - Authentication, Tenants, Memberships, Subscriptions, API Keys, etc - are fully tested. For the custom entities, the codebase includes template files that you can use to write your own tests. The reason is that because the custom entities can have any form, there is no way to anticipate the scenarios that need to be tested.

End-to-end Tests using Playwright

The command to run the end-to-end tests is:

npm run test:e2e

This will open the Playwright UI for you to start and watch the tests run.

Backend tests using Jest

The command to run the backend tests is:

npm run test:backend