- Install dependencies:
pnpm install
- Create a
.env
file based on.env.example
.
To run the development server, use the following command:
pnpm dev
Alternatively, to run the application using Docker, follow these steps:
-
Create a
.env
file based on.env.example
. -
Run with docker compose:
docker compose up
To add tests to the codebase, follow these steps:
-
Create Test Files: Place your test files in the
__tests__
directory, mirroring the structure of your codebase. For example, tests forVaultCard.tsx
should be in__tests__/components/VaultCard/VaultCard.test.tsx
. -
Mock Dependencies: Use Jest to mock any hooks, context, or components that the component under test depends on. This isolates the component and allows you to test it in isolation.
-
Use
mockHooks
Abstraction: Create amockHooks
function to set up mock return values for hooks used in your component. This helps streamline the setup for each test case. -
Test Component Behavior: Write tests to verify that the component behaves as expected under different conditions. This includes checking that it renders correctly, handles user interactions, and updates state as expected.
-
Run Tests: Use the command
pnpm test
to run your test suite and ensure all tests pass.
Here's an example test suite for the VaultCard
component, using the mockHooks
abstraction: