Skip to content

Commit

Permalink
test: Update testing libraries (#1822)
Browse files Browse the repository at this point in the history
* test: Update versions for all test libs

* test: Update snapshots to reflect new package versions
  • Loading branch information
iRoachie committed May 26, 2019
1 parent b0116f2 commit 7e9bfcc
Show file tree
Hide file tree
Showing 32 changed files with 2,816 additions and 3,035 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

3 changes: 3 additions & 0 deletions babel.config.js
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
30 changes: 16 additions & 14 deletions package.json
Expand Up @@ -45,14 +45,13 @@
"@types/react": "^16.4.16",
"@types/react-native": "^0.57.4",
"babel": "^6.23.0",
"babel-core": "^6.23.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "22.4.3",
"babel-jest": "^24.3.1",
"babel-loader": "^6.3.2",
"babel-preset-react-native": "4.0.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"enzyme-to-json": "^3.3.4",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.10.0",
"enzyme-to-json": "^3.3.5",
"eslint": "^5.10.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.3.0",
Expand All @@ -63,17 +62,18 @@
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-react-native": "^3.5.0",
"file-loader": "^0.11.1",
"husky": "^1.1.2",
"husky": "^1.3.1",
"image-webpack-loader": "^3.3.1",
"jest": "23.5.0",
"jest-transform-stub": "^1.0.0",
"lint-staged": "^8.0.4",
"jest": "^24.3.1",
"jest-transform-stub": "^2.0.0",
"lint-staged": "^8.1.5",
"metro-react-native-babel-preset": "^0.49.0",
"prettier": "^1.15.3",
"react": "16.3.1",
"react": "16.6.3",
"react-dom": "16.3.3",
"react-native": "0.55.4",
"react-native": "0.58.6",
"react-native-vector-icons": "^6.0.2",
"react-test-renderer": "^16.6.0",
"react-test-renderer": "16.6.3",
"webpack": "^2.2.1"
},
"peerDependencies": {
Expand All @@ -94,7 +94,9 @@
"globals": {
"__DEV__": true
},
"setupTestFrameworkScriptFile": "./.ci/setupTests.js",
"setupFilesAfterEnv": [
"<rootDir>/.ci/setupTests.js"
],
"transform": {
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
}
Expand Down
4 changes: 1 addition & 3 deletions src/avatar/__tests__/Avatar.js
Expand Up @@ -234,9 +234,7 @@ describe('Avatar Component', () => {
/>
);

expect(component.dive().props().style.backgroundColor).toBe(
'transparent'
);
expect(component.props().style.backgroundColor).toBe('transparent');
expect(toJson(component)).toMatchSnapshot();
});
});
Expand Down
67 changes: 32 additions & 35 deletions src/avatar/__tests__/__snapshots__/Avatar.js.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Avatar Component Edit button android 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -58,21 +58,21 @@ exports[`Avatar Component Edit button android 1`] = `
}
underlayColor="#000"
>
<Component>
<View>
<Themed.Icon
color="#fff"
name="mode-edit"
size={9.066666666666668}
type="material"
underlayColor="#000"
/>
</Component>
</View>
</TouchableHighlight>
</Component>
</View>
`;

exports[`Avatar Component Edit button ios 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -129,21 +129,21 @@ exports[`Avatar Component Edit button ios 1`] = `
}
underlayColor="#000"
>
<Component>
<View>
<Themed.Icon
color="#fff"
name="mode-edit"
size={9.066666666666668}
type="material"
underlayColor="#000"
/>
</Component>
</View>
</TouchableHighlight>
</Component>
</View>
`;

exports[`Avatar Component Placeholders renders using icon prop 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -187,11 +187,11 @@ exports[`Avatar Component Placeholders renders using icon prop 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Placeholders renders using icon with defaults 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -234,11 +234,11 @@ exports[`Avatar Component Placeholders renders using icon with defaults 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Placeholders shouldn't show placeholder if not using source 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand All @@ -251,9 +251,6 @@ exports[`Avatar Component Placeholders shouldn't show placeholder if not using s
ImageComponent={[Function]}
PlaceholderContent={
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -285,11 +282,11 @@ exports[`Avatar Component Placeholders shouldn't show placeholder if not using s
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Sizes accepts a number 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -320,11 +317,11 @@ exports[`Avatar Component Sizes accepts a number 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Sizes accepts large 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -355,11 +352,11 @@ exports[`Avatar Component Sizes accepts large 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Sizes accepts medium 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -390,11 +387,11 @@ exports[`Avatar Component Sizes accepts medium 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Sizes accepts small 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -425,11 +422,11 @@ exports[`Avatar Component Sizes accepts small 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Sizes accepts xlarge 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -460,11 +457,11 @@ exports[`Avatar Component Sizes accepts xlarge 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component Sizes defaults to small if invalid string given 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -495,11 +492,11 @@ exports[`Avatar Component Sizes defaults to small if invalid string given 1`] =
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component allows custom imageProps 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -531,11 +528,11 @@ exports[`Avatar Component allows custom imageProps 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component renders rounded 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -569,7 +566,7 @@ exports[`Avatar Component renders rounded 1`] = `
}
}
/>
</Component>
</View>
`;

exports[`Avatar Component renders touchable if onPress given 1`] = `
Expand Down Expand Up @@ -760,7 +757,7 @@ exports[`Avatar Component should apply values from theme 1`] = `
`;

exports[`Avatar Component should render without issues 1`] = `
<Component
<View
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -791,5 +788,5 @@ exports[`Avatar Component should render without issues 1`] = `
}
}
/>
</Component>
</View>
`;

0 comments on commit 7e9bfcc

Please sign in to comment.