Skip to content

Instantly share code, notes, and snippets.

View goodpic's full-sized avatar

Jun Kaneko goodpic

View GitHub Profile
@goodpic
goodpic / HookTest.tsx
Created September 12, 2019 17:10
React Native Hooks example to test
import * as React from 'react'
import { useState } from 'react'
import {
NativeSyntheticEvent, Text, TextInput, TextInputSubmitEditingEventData,
TouchableOpacity, View} from 'react-native'
interface IProps {
myMock?: () => void
}
@goodpic
goodpic / HookTest.spec.ts
Created September 12, 2019 17:12
Test React Hooks with react-native-testing-library
import * as React from 'react'
import { fireEvent, render } from 'react-native-testing-library'
import { HookTest } from '../HookTest'
describe('Test Hooks', () => {
test('changeText', () => {
const { getByTestId, getByPlaceholder, queryByDisplayValue } = render(
<HookTest />)