react-native/Libraries/Image
Martin Yrjölä 25639176ff Asset basenames in Jest snapshots
Summary:
This change only affects tests run with Jest. `require('/images/image1.png')` will be replaced with

```
Object {
  "testUri": "relative/path/to/images/image1.png",
}
```

in the Jest snapshot instead of always being 1 returned by RelativeImageStub. This change makes it possible to test conditional asset loading in components.

The problem with this change is that it will probably break a lot of existing snapshots, but that should be easily fixed when a project updates to a new version of React Native by running `jest -u` to update all snapshots.

A component can have conditional asset loading based on its props, this logic would be nice to test with Jest snapshots. This problem has been discussed in https://github.com/facebook/jest/issues/2838.

* **Who does this affect**: Everyone using `Image` in Jest snapshots
* **How to migrate**: Running `jest -u` will update the snapshots, the snapshots should be reviewed that they are correct.
* **Why make this breaking change**: It enables testing of conditional asset loading.
* **Severity (number of people affected x effort)**: Low.
Closes https://github.com/facebook/react-native/pull/13319

Reviewed By: rafeca

Differential Revision: D5708180

Pulled By: mjesun

fbshipit-source-id: 16ac42004d597db08545a21d4fffe95c5ee7e21f
2017-09-06 03:33:43 -07:00
..
RCTImage.xcodeproj Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
__tests__ Asset basenames in Jest snapshots 2017-09-06 03:33:43 -07:00
AssetRegistry.js
AssetSourceResolver.js
Image.android.js Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
Image.ios.js Update OSS Fresco dependency 2017-07-12 07:54:09 -07:00
ImageBackground.js Fix React Native open source 2017-08-29 15:01:05 -07:00
ImageEditor.js
ImageResizeMode.js
ImageSource.js
ImageSourcePropType.js Update remaining PropTypes references 2017-06-12 16:03:09 -07:00
ImageStore.js
ImageStylePropTypes.js Update remaining PropTypes references 2017-06-12 16:03:09 -07:00
RCTGIFImageDecoder.h
RCTGIFImageDecoder.m
RCTImageBlurUtils.h
RCTImageBlurUtils.m
RCTImageCache.h
RCTImageCache.m
RCTImageEditingManager.h
RCTImageEditingManager.m
RCTImageLoader.h
RCTImageLoader.m Clean up some URL path handling 2017-09-01 13:45:03 -07:00
RCTImageShadowView.h
RCTImageShadowView.m
RCTImageStoreManager.h
RCTImageStoreManager.m RCTImage: Use C atomics instead of OSAtomic 2017-08-01 02:51:03 -07:00
RCTImageUtils.h Fix photo orientation from ImagePickerIOS 2017-07-24 21:51:51 -07:00
RCTImageUtils.m Fix photo orientation from ImagePickerIOS 2017-07-24 21:51:51 -07:00
RCTImageView.h
RCTImageView.m Call reloadImage less often when setting Image props 2017-08-29 04:23:04 -07:00
RCTImageViewManager.h
RCTImageViewManager.m
RCTLocalAssetImageLoader.h
RCTLocalAssetImageLoader.m RCTImage: Use C atomics instead of OSAtomic 2017-08-01 02:51:03 -07:00
RCTResizeMode.h
RCTResizeMode.m
RelativeImageStub.js Remove remnants of the packager 2017-07-07 03:06:21 -07:00
nativeImageSource.js
resolveAssetSource.js