React NativeTesting (Unit, Component & E2E)

122 items

1

Testing Navigation-Dependent Components

Slides / Video
2

Asserting Element Presence

Code Quiz
3

Detox waitFor Synchronization

Code Quiz
4

Rendering With a Context Provider

Code Quiz
5

Mocking Network Requests in Tests

Slides / Video
6

Testing Async Code with async/await

Code Quiz
7

Accessibility Queries getByRole

Code Quiz
8

getBy vs queryBy vs findBy

Code Quiz
9

Querying by testID with getByTestId

Code Quiz
10

Querying by Text with getByText

Code Quiz
11

Rendering with RNTL render

Code Quiz
12

Spying with jest.spyOn

Code Quiz
13

Faking Timers with jest.useFakeTimers

Code Quiz
14

Simulating User Events with fireEvent

Slides / Video
15

Using testID for Element Selection

Slides / Video
16

Querying Elements in Tests

Slides / Video
17

Rendering Components with render()

Slides / Video
18

React Native Testing Library Overview

Slides / Video
19

Mocking Native Modules & Timers

Slides / Video
20

Mocking Functions with jest.fn & Spies

Slides / Video
21

Mocking Modules with jest.mock

Slides / Video
22

Setup & Teardown: beforeEach, afterEach

Slides / Video
23

Common Jest Matchers

Slides / Video
24

Test Structure: describe, it, expect

Slides / Video
25

Comparing Objects with toBe

Code Quiz
26

Wrong Setup Hook for Reset

Code Quiz
27

Jest Preset for React Native

Code Quiz
28

Broken describe Block Syntax

Code Quiz
29

Matcher Not Actually Invoked

Code Quiz
30

jest.fn Missing Parentheses

Code Quiz
31

Over-Mocking the react-native Module

Code Quiz
32

jest.mock Factory Returns Nothing

Code Quiz
33

Unit Testing Functions & Utilities

Slides / Video
34

Simulators vs Real Devices

Flashcard
35

Configuring Jest for React Native

Slides / Video
36

Jest as the Default Test Runner

Slides / Video
37

Testing Pyramid: Unit, Component, E2E

Slides / Video
38

What & What Not to Test

Slides / Video
39

Running Tests in CI/CD Pipelines

Slides / Video
40

Test Coverage Reports & Thresholds

Slides / Video
41

Writing E2E Test Flows on Device

Slides / Video
42

Maestro as an E2E Testing Alternative

Slides / Video
43

Enabling Jest Coverage Reports

Code Quiz
44

Mocking Fetch in a Test

Code Quiz
45

Detox Visibility Expectation

Code Quiz
46

Detox Tap and Type Actions

Code Quiz
47

Detox Test Structure Basics

Code Quiz
48

Cleaning Up Between Tests

Code Quiz
49

Mocking Navigation Prop

Code Quiz
50

Detox for End-to-End Testing

Slides / Video
51

Firing a Press Event

Code Quiz
52

Testing a Custom Hook

Code Quiz
53

Waiting for Async UI

Code Quiz
54

Snapshot Testing a Component

Code Quiz
55

Verifying a Callback Prop

Code Quiz
56

Simulating Text Input

Code Quiz
57

Wrapping State Updates in act

Code Quiz
58

Testing Components with Providers

Slides / Video
59

Mocking Modules with jest.mock

Quiz
60

Testing with Context Providers

Quiz
61

Testing State Changes

Quiz
62

Test Structure Basics

Quiz
63

Testing Custom Hooks

Quiz
64

Handling act() Warnings

Quiz
65

Jest Config for React Native

Quiz
66

jest.fn vs jest.spyOn

Quiz
67

Running Tests in CI

Quiz
68

Async Queries and waitFor

Quiz
69

Setup and Teardown Hooks

Quiz
70

Testing Pyramid Strategy

Quiz
71

Detox Synchronization

Quiz
72

Testing with Navigation

Quiz
73

Simulating Events with fireEvent

Quiz
74

Maestro E2E Flows

Quiz
75

Faking Timers

Quiz
76

Unit Testing Pure Functions

Quiz
77

Rendering with render()

Quiz
78

Mocking fetch Requests

Quiz
79

Detox E2E Fundamentals

Quiz
80

Detox Matchers and Actions

Quiz
81

Testing Props and Conditional Rendering

Quiz
82

Common Jest Matchers

Quiz
83

Querying by testID and Text

Quiz
84

Coverage Thresholds

Quiz
85

Mocking Native Modules

Quiz
86

Snapshot Testing Trade-offs

Quiz
87

Snapshot Testing Components

Slides / Video
88

Testing Hooks with renderHook

Slides / Video
89

Asserting Component Output

Slides / Video
90

Testing Hooks with renderHook

Flashcard
91

Simulators/Emulators vs Real Devices

Flashcard
92

Updating Stale Snapshots

Flashcard
93

Snapshot Testing Components

Flashcard
94

Querying Elements in RNTL

Flashcard
95

Maestro for E2E Flow Testing

Flashcard
96

Detox for End-to-End Testing

Flashcard
97

Spying with jest.spyOn

Flashcard
98

Unit Testing Pure Functions

Flashcard
99

Jest as the Default Test Runner

Flashcard
100

Structuring Tests with describe and it

Flashcard
101

Running Tests in CI/CD

Flashcard
102

Mocking Network Calls

Flashcard
103

Configuring the react-native Preset

Flashcard
104

Mocking with jest.mock and jest.fn

Flashcard
105

Mocking Timers with useFakeTimers

Flashcard
106

Mocking Native Modules and AsyncStorage

Flashcard
107

React Native Testing Library Philosophy

Flashcard
108

Setup and Teardown Hooks

Flashcard
109

Jest Matchers and expect

Flashcard
110

The Testing Pyramid

Flashcard
111

Appium as an E2E Alternative

Flashcard
112

Wrapping Updates in act()

Flashcard
113

Mocking Navigation in Tests

Flashcard
114

Testing Async UI with waitFor

Flashcard
115

Test Coverage Reporting

Flashcard
116

Debugging Failing Tests

Flashcard
117

Using testID for Selection

Flashcard
118

Simulating Events with fireEvent

Flashcard
119

Writing E2E Test Flows

Flashcard
120

Providing Context and Store Wrappers

Flashcard
121

Rendering Components with render()

Flashcard
122

Testing Async UI with waitFor & findBy

Slides / Video
Code QuizIntermediate

Spying with jest.spyOn

Find the mistake when spying on a module method with jest.spyOn.

Codejavascript
import * as analytics from './analytics';

test('logs an event when button pressed', () => {
  const spy = jest.spyOn(analytics, 'trackEvent');

  logButtonPress();

  expect(spy).toHaveBeenCalled;
});

What is the bug in this test?