Files
meshtastic-web/packages/web/src/__mocks__
Dan DitomasoandGitHub c729d3b25e fix: resolve lint warnings/errors and apply formatting (#1024)
* fix: resolve lint warnings/errors and apply formatting

Fix 10 oxlint issues (2 errors, 8 warnings):
- Remove unused catch parameters in Security.tsx and ImportDialog.tsx
- Remove stray expression in Generator.tsx
- Add eslint-disable for debounced useCallback in FilterControl.tsx
- Remove unnecessary deps (resolveDB, store) in bindStoreToDevice.ts
- Prefix unused variant param in AppSidebar.tsx
- Memoize tabs arrays in DeviceConfig, RadioConfig, ModuleConfig
- Fix channels type in RadioConfig TabItem

Also applies oxfmt formatting across all files.

* updating lock file

* update protobuf package

* fix: regenerate pnpm-lock.yaml and exclude jsr protobufs from minimumReleaseAge

* prevented http card from always being polled

* updated pnpm config fiile

* updated actions

* removed biome config and lint system leftovers

* updating protobuf package
2026-03-11 21:54:25 -04:00
..

Mocks Directory

This directory contains mock implementations used by Vitest for testing.

Structure

The directory structure mirrors the actual project structure to make mocking more intuitive:

__mocks__/
├── components/
│   └── UI/
│       ├── Dialog.tsx
│       ├── Button.tsx
│       ├── Checkbox.tsx
│       └── ...
├── core/
│   └── ...
└── ...

Auto-mocking

Vitest will automatically use the mock files in this directory when the corresponding module is imported in tests. For example, when a test imports @components/UI/Dialog.tsx, Vitest will use __mocks__/components/UI/Dialog.tsx instead.

Creating New Mocks

To create a new mock:

  1. Create a file in the same relative path as the original module
  2. Export the mocked functionality with the same names as the original
  3. Add a vi.mock() statement to vitest.setup.ts if needed

Mock Guidelines

  • Keep mocks as simple as possible
  • Use data-testid attributes for easy querying in tests
  • Implement just enough functionality to test the component
  • Use TypeScript types to ensure compatibility with the original module