This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check version | |
node -v || node --version | |
// list locally installed versions of node | |
nvm ls | |
// list remove available versions of node | |
nvm ls-remote | |
// install specific version of node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AsyncStorage from '@react-native-async-storage/async-storage'; | |
import create from 'zustand'; | |
import { persist } from 'zustand/middleware'; | |
export const useSomthingStore = create<TSomthingStore>( | |
persist( | |
(set, get) => ({ | |
isTrue: false, | |
_hasHydrated: false, | |
setHasHydrated: state => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('@react-navigation/native', () => { | |
return { | |
useNavigation: () => ({ | |
navigate: jest.fn(), | |
dispatch: jest.fn(), | |
}), | |
useRoute: () => ({ | |
params: { | |
id: '123', | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { device, element, by, expect } from 'detox'; | |
describe('StudioGhibliSearchEngineApp', () => { | |
beforeEach(async () => { | |
await device.reloadReactNative(); | |
}); | |
it('should display heading', async () => { | |
await waitFor(element(by.id('search-page'))).toBeVisible().withTimeout(5000); | |
await expect(element(by.id('heading'))).toBeVisible(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { device, element, by, expect } from 'detox'; | |
describe('Search', () => { | |
beforeEach(async () => { | |
await device.reloadReactNative(); | |
}); | |
it('should show a list of results and go to film details', async () => { | |
await waitFor(element(by.id('search-page'))) | |
.toBeVisible() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { device, element, by, expect } from 'detox'; | |
describe('<your page>', () => { | |
beforeEach(async () => { | |
await device.reloadReactNative(); | |
}); | |
it('should ...', async () => { | |
await waitFor(element(by.id('your page testID'))) | |
.toBeVisible() |