
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
react-native-navigation-mock-render
Advanced tools
Enzyme render mock of wix/react-native-navigation
Work in progress, stay tuned.
Thin node.js mock of wix/react-native-navigation that makes it possible to write fast integration test including:
Uses:
react-native
>= 0.49react
>= 16.0.0yarn add --dev react-native-navigation-mock-render jsdom@^11.5.1 enzyme@^3.3.0 enzyme-adapter-react-16@^1.1.1 react-native-mock-render@^0.0.19
/* @flow */
import { Navigation } from 'react-native-navigation'
import 'react-native-navigation-mock-render/lib/setup-enzyme-environment'
import { getEnzymeAppWrapper } from 'react-native-navigation-mock-render/lib/platform'
import { IntroScreen } from '../screens/intro'
import startApplication from '../index'
jest.mock('react-native-navigation/src/deprecated/platformSpecificDeprecated', () =>
// $FlowFixMe: Jest adds requireActual
require.requireActual('react-native-navigation-mock-render/lib/platform')
)
jest.mock('react-native-navigation/src/ScreenVisibilityListener', () =>
// $FlowFixMe: Jest adds requireActual
require.requireActual(
'react-native-navigation-mock-render/lib/ScreenVisibilityListener'
)
)
const wrapper = getEnzymeAppWrapper()
export const flushAllPromises = (): Promise<void> =>
new Promise(resolve => setImmediate(resolve))
describe('app integration test', () => {
it('shows authentication screen after stepping through intro', async () => {
startApplication()
await flushAllPromises()
let screenId = await Navigation.getCurrentlyVisibleScreenId()
expect(screenId).toEqual('MyApp.Intro')
const introInstance = wrapper
.find(IntroScreen)
.first()
.instance()
introInstance.onAcceptTermsPressed()
await flushAllPromises()
screenId = await Navigation.getCurrentlyVisibleScreenId()
expect(screenId).toEqual('MyApp.MainScreen')
})
})
Still early stages. First focus is apps using startSingleScreenApp
.
Besides:
ScreenVisibilityListener
have been implementedNavigation
methods have been implemented (e.g. startTabBasedApp
, showContextualMenu
)To get started, run:
yarn
When developing:
yarn run lint
MIT
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.