ရိုးရိုးလေး ရှင်းပြမယ်
Testing, React Native DevTools & Profiling ကို ရိုးရိုးလေးနားလည်မယ်
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 တိုင်းအတည်ပြုပါ။
Problem → Why → Solution
ပြဿနာ — ဘာကြောင့် ဒီ concept လိုတာလဲ
Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
ဖြစ်လေ့ရှိတဲ့အမှား
Web CSS/DOM assumptions ကို React Native တွင်တိုက်ရိုက်သုံးခြင်း၊ subscription မပိတ်ခြင်း သို့ platform differences ကို condition အများကြီးဖြင့် component ထဲရောထည့်ခြင်း။
Core Concept — အလုပ်လုပ်ပုံကိုနားလည်မယ်
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 တိုင်းအတည်ပြုပါ။
- Device behavior
- Measure + verify
- Smooth accessible UI
Testing, React Native DevTools & Profiling ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
အဓိက Syntax / Pattern
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);
});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 တိုင်းအတည်ပြုပါ။
Code ကို အဆင့်လိုက်ဖတ်မယ်
- Device behavior
import { render, screen, userEvent } from '@testing-l...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 တိုင်းအတည်ပြုပါ။
- Measure + verify
const user = userEvent.setup();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 တိုင်းအတည်ပြုပါ။
- Smooth accessible UI
});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 ကိုလိုအပ်သလိုအသုံးပြုပါ။
- Device behavior
- Measure + verify
- Smooth accessible UI
Success
Testing, React Native DevTools & Profiling ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
Failure
Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
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 တိုင်းအတည်ပြုပါ။
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);
});1 test passedReal-world usage
လက်တွေ့ Project မှာ ဘယ်လိုသုံးမလဲ
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 ကိုလိုအပ်သလိုအသုံးပြုပါ။
Mini challenge
ကိုယ်တိုင်တည်ဆောက်ကြည့်ပါ
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 ကိုလိုအပ်သလိုအသုံးပြုပါ။
- Example ကို copy မလုပ်ဘဲ ပြန်ရေးပါ
- Normal input နဲ့ edge case စမ်းပါ
- Run မလုပ်မီ compiler/output result ကိုခန့်မှန်းပါ
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);
});ရလဒ်: Testing, React Native DevTools & Profiling ရဲ့ React နဲ့ native platform behavior ကိုရှင်းပြနိုင်ရန်
အရိပ်အမြွက် ကြည့်ရန်
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 ကိုလိုအပ်သလိုအသုံးပြုပါ။
Quick Quiz 1 / 3
Quick Quiz 2 / 3
Quick Quiz 3 / 3
ဒီသင်ခန်းစာမှာ မှတ်ထားရမယ့်အချက်များ
- Device behavior → Measure + verify → Smooth accessible UI
- 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 တိုင်းအတည်ပြုပါ။
- Simulator တစ်ခု၏ happy path မှန်ရုံဖြင့် real devices, release builds, permissions, accessibility, offline နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
- 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 ကိုလိုအပ်သလိုအသုံးပြုပါ။
Testing Overview — React Native