协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
react-native-testing【开发与工程】Test React Native components with Jest and React Native Testing Library. Use when writing Jest or React Native Testing Library tests for React Native components.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
[MOB-TEST-01] Tripartite Naming: Follow Method_Scenario_ExpectedBehavior.[MOB-TEST-02] State & Component Invariant Rule: Assert on visible user outcomes and accessible UI elements; never inspect component internal state or props directly.[MOB-TEST-03] Entity Invariant Rule: Test calculations, validations, and domain invariants; ban trivial echo assertions.[MOB-TEST-04] Contract Testing Rule: Intercept network requests at HTTP boundary (MSW) or native module boundary; ban 1:1 pass-through mock echoing without contract assertions.[MOB-TEST-05] Bug-First Regression Lock: Every PR resolving a bug ticket or with title fix(...) must introduce a test reproducing the defect prior to the fix.@testing-library/react-native for user-centric tests. Mock native modules with jest.mock().test('increments counter on button press', () => {
const { getByText, getByRole } = render(<Counter />);
fireEvent.press(getByRole('button', { name: /increment/i }));
expect(getByText('Count: 1')).toBeTruthy();
});
getByRole, getByText over testID. Use findBy* for async elements.testID overuse.See references/testing-library.md for RNTL setup, mocking providers, and integration flow examples.
When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
Integration
RNTL
Additional task-grounded exact anchors: test behavior