Thuta Learning
React Native
AdvancedMobile Developmentintermediate

Testing, React Native DevTools & Profiling

React Nativeသင်ခန်းစာ 25

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Testing, React Native DevTools & Profiling ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
  • Accessibility, failure နဲ့ lifecycle cases စမ်းနိုင်ရန်
  • Maintainable, testable နဲ့ performant React Native code ရေးနိုင်ရန်

Testing, React Native DevTools & Profiling ကို Debug build တစ်ခုတည်းဖြင့်မဆုံးဖြတ်ဘဲ release device ပေါ်တွင် startup, JS/UI frame rate, memory, network, crash recovery, permissions, signing နဲ့ store requirements ဖြင့်စစ်ပါ။ New Architecture compatibility နဲ့ dependency support ကို upgrade တိုင်းအတည်ပြုပါ။

ပိုပြီးနားလည်ထားရမယ့် အချက်

Testing, React Native DevTools & Profiling ကို Debug build တစ်ခုတည်းဖြင့်မဆုံးဖြတ်ဘဲ release device ပေါ်တွင် startup, JS/UI frame rate, memory, network, crash recovery, permissions, signing နဲ့ store requirements ဖြင့်စစ်ပါ။ New Architecture compatibility နဲ့ dependency support ကို upgrade တိုင်းအတည်ပြုပါ။

လက်တွေ့မှာ ဘယ်လိုအသုံးချမလဲ

Testing, React Native DevTools & Profiling example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

ဒီသင်ခန်းစာပြီးရင်

tsx
import { render, screen, userEvent } from '@testing-library/react-native';
import { SaveButton } from './SaveButton';

test('saves through an accessible button', async () => {
  const onSave = jest.fn();
  const user = userEvent.setup();
  render(<SaveButton onSave={onSave} />);
  await user.press(screen.getByRole('button', { name: 'Save' }));
  expect(onSave).toHaveBeenCalledTimes(1);
});
You should see
1 test passed

ကိုယ်တိုင်စမ်းကြည့်ရန်

Testing, React Native DevTools & Profiling example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

Platform/Lifecycle သတိပေးချက်

Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။

Testing OverviewReact Native

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
  • Web CSS/DOM assumptions ကို React Native တွင်တိုက်ရိုက်သုံးခြင်း၊ subscription မပိတ်ခြင်း သို့ platform differences ကို condition အများကြီးဖြင့် component ထဲရောထည့်ခြင်း။

လက်တွေ့လေ့ကျင့်ခန်း

Testing, React Native DevTools & Profiling example ကို Android/iOS, small/large screens, font scaling, dark mode, keyboard, screen reader, slow/offline network, denied permissions နဲ့ app background/foreground cases ဖြင့်စမ်းပါ။ DevTools, tests နဲ့ release build ကိုလိုအပ်သလိုအသုံးပြုပါ။

You'll know it worked when: 1 test passed