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
// Tune promises (we use Bluebird, but with setImmediate instead of nextTick etc optimizations...) | |
// It will allow to us call jest.runAllImmediates() to force promises queue flush | |
global.Promise = require('App/promise').default | |
global.Promise.setScheduler(function(fn) { | |
setImmediate(fn) | |
}) | |
jest.mock('NativeEventEmitter') | |
const NativeModules = { |
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
/* This SnapshotHelper class should be compatible with SnapshotHelper.swift version 1.2 */ | |
@import Foundation; | |
@import XCTest; | |
@interface SnapshotHelper : NSObject | |
- (instancetype)initWithApp:(XCUIApplication*)app; | |
- (void)snapshot:(NSString*)name waitForLoadingIndicator:(BOOL)wait; |
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 React from 'react' | |
import { | |
EmitterSubscription, | |
Keyboard, | |
LayoutAnimation, | |
LayoutChangeEvent, | |
LayoutRectangle, | |
Platform, | |
StyleSheet, | |
View, |
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
type Body = string | FormData | { uri: string } | ArrayBufferLike | ArrayBufferView | |
interface IUploadOptions { | |
body?: Body | |
headers?: { [k: string]: string } | |
method?: 'GET' | 'POST' | |
} | |
function upload( | |
url: string, | |
opts: IUploadOptions = {}, |
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
funciton MyComp() { | |
return ( | |
<View style={{ flexDirection: 'row', borderColor: 'blue', borderWidth: StyleSheet.hairlineWidth }}> | |
<View style={{ width: 100, height: 100, backgroundColor: 'green' }} /> | |
<Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse ultricies finibus elementum.</Text> | |
</View> | |
) | |
} |
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
Increment without transaction | |
before incrementCounter cnt=0 | |
after incrementCounter cnt=1 | |
reaction computed=1 | |
reaction cnt=1 | |
Two increments with transaction | |
before incrementCounter cnt=1 | |
after incrementCounter cnt=2 | |
Current immediate value in transaction cnt=2 | |
before incrementCounter cnt=2 |
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
mport 'jest' | |
import { clock } from 'testing/setupFakeTimers' | |
import { TestController as Ctrl } from 'testing/testController' | |
import React from 'react' | |
import Renderer, { act } from 'react-test-renderer' | |
beforeEach(() => { | |
// simplifyed code |
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
// android/app/build.gradle | |
// ... some RN stuff | |
apply plugin: 'com.google.gms.google-services' | |
dependencies { | |
implementation fileTree(dir: "libs", include: ["*.jar"]) | |
implementation "com.android.support:appcompat-v7:${rootProject.supportLibVersion}" | |
implementation "com.android.support:cardview-v7:${rootProject.supportLibVersion}" | |
implementation "com.android.support:customtabs:${rootProject.supportLibVersion}" |
NewerOlder