一键导入
tests-native
// Use when writing component or hook tests in suite-native and need to choose between renderWithBasicProvider, renderWithStoreProvider, or store helpers like createStoreFromPreloadedState, createLightStore, or mergePreloadedState.
// Use when writing component or hook tests in suite-native and need to choose between renderWithBasicProvider, renderWithStoreProvider, or store helpers like createStoreFromPreloadedState, createLightStore, or mergePreloadedState.
How to create and structure packages in the Trezor Suite monorepo, including scopes and sizing guidance. Use when creating new packages or resolving cyclic dependencies.
publishConfig rules for public npm packages in the Trezor Suite monorepo. Use when adding or editing publishConfig, exports, or preparing a package for npm publishing.
Generated code must be aligned with security headers (e.g. no unsave JS eval). The permissions policy is especially relevant when changing any code related with the `navigator` object.
Trigger on any mention of Trezor wallet interaction, crypto addresses, sending crypto, checking balances, signing messages, or hardware wallet operations via MCP. Also trigger when users mention configuring or troubleshooting the Trezor MCP server connection.
How to create and implement IndexedDB storage migrations in the Trezor Suite web app. Use when writing migrations that transform persisted data between Suite versions.
If-else formatting, spacing, function parameters, and conditional rendering rules for the Trezor Suite codebase. Use when writing or reviewing TypeScript/React code.
| name | tests-native |
| description | Use when writing component or hook tests in suite-native and need to choose between renderWithBasicProvider, renderWithStoreProvider, or store helpers like createStoreFromPreloadedState, createLightStore, or mergePreloadedState. |
Two packages provide testing utilities for suite-native. Pick the one that fits your test:
| Need | Package |
|---|---|
| Component or hook test with no Redux store | @suite-native/test-utils |
| Component or hook test that reads from or dispatches to a Redux store | @suite-native/test-utils-store |
Never import directly from @testing-library/react-native — both packages re-export it.
@suite-native/test-utilsProvides renderWithBasicProvider and renderHookWithBasicProvider, which wrap the component with theme, safe-area,
intl, and formatters providers. Also exports BasicProviderForTests, extraDependenciesNativeMock, and all of
@testing-library/react-native.
BasicProviderForTests is the underlying wrapper component used by both render helpers. Use it directly only when you
need to pass it as a wrapper option to a custom render or hook call — for example, when composing your own render
helper or when the testing-library API requires a wrapper component rather than a pre-rendered tree.
@suite-native/test-utils-storeExtends @suite-native/test-utils with Redux support. Provides renderWithStoreProvider and
renderHookWithStoreProvider — both accept the same options: preloadedState?: Record<string, unknown> or a
pre-built store?: TestStore. Plus store factory helpers:
createStoreFromPreloadedState(preloadedState?) — static (no-op) reducers; use when the test only reads state.createLightStore({ reducer, preloadedState }) — real reducers; use when the test dispatches actions that must mutate
state.createStaticReducer(initialState) — creates a no-op reducer for slices the test does not interact with.mergePreloadedState(base, overrides) — deep-merges a partial overrides into a complete typed base state object
and returns it typed as base. Use this to build the preloadedState arg: start from a fully-constructed state
(e.g. the result of store.getState() on a default store) and override only the slices the test cares about.