react-native-fit-image
Advanced tools
Comparing version 1.4.1 to 1.4.2
{ | ||
"name": "react-native-fit-image", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Responsive image component to fit perfectly itself.", | ||
@@ -35,2 +35,3 @@ "main": "dist/FitImage.js", | ||
"react-native-mock": "^0.2.2", | ||
"sinon": "^1.17.6", | ||
"tap-diff": "^0.1.1", | ||
@@ -37,0 +38,0 @@ "tape": "^4.5.1" |
@@ -47,2 +47,8 @@ # React Native Fit Image [![npm version](https://badge.fury.io/js/react-native-fit-image.svg)](https://badge.fury.io/js/react-native-fit-image) | ||
// could use resizeMode | ||
<FitImage | ||
resizeMode="contain" | ||
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }} | ||
/> | ||
// or draws image to specific size like Image component. | ||
@@ -49,0 +55,0 @@ <FitImage |
import test from 'tape'; | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { stub } from 'sinon'; | ||
@@ -8,7 +9,6 @@ import FitImage from '../src/FitImage'; | ||
test('FitImage', nest => { | ||
const setup = (props = {}) => { | ||
const setup = (passedProps = {}) => { | ||
const source = { uri: 'http://facebook.github.io/react/img/logo_og.png' }; | ||
const defaultProps = { source }; | ||
props = { ...props, ...defaultProps } | ||
const props = { ...passedProps, ...defaultProps }; | ||
const wrapper = shallow(<FitImage {...props} />); | ||
@@ -21,3 +21,3 @@ | ||
assert.throws( | ||
() => { setup({ width: 100 }); }, Error, | ||
() => { setup({ style: { width: 100 } }); }, Error, | ||
'when width props exist without height' | ||
@@ -27,3 +27,3 @@ ); | ||
assert.throws( | ||
() => { setup({ height: 100 }); }, Error, | ||
() => { setup({ style: { height: 100 } }); }, Error, | ||
'when height props exist without width' | ||
@@ -30,0 +30,0 @@ ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10529
137
73
10