Skip to content

Commit

Permalink
Upgrades deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlplusb committed Oct 11, 2019
1 parent d433fdd commit 56cf111
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 154 deletions.
41 changes: 22 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"test:coverage": "npm run test -- --coverage",
"test:coverage:deploy": "npm run test:coverage && codecov"
},
"resolutions": {
"@types/react": "16.9.5"
},
"dependencies": {
"element-resize-detector": "^1.1.15",
"invariant": "^2.2.4",
Expand All @@ -43,8 +46,8 @@
"react-dom": "^0.14.0 || ^15.0.0-0 || ^16.0.0"
},
"devDependencies": {
"@types/react": "^16.8.8",
"@types/react-dom": "^16.8.2",
"@types/react": "^16.9.5",
"@types/react-dom": "^16.9.1",
"app-root-dir": "1.0.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
Expand All @@ -58,36 +61,36 @@
"babel-preset-stage-3": "6.24.1",
"babel-register": "^6.26.0",
"change-case": "^3.0.2",
"codecov": "^3.0.2",
"cross-env": "^5.2.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.4",
"codecov": "^3.6.1",
"cross-env": "^6.0.3",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.2",
"eslint": "^4.7.2",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.9.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.16.0",
"gzip-size": "^4.0.0",
"husky": "^0.14.3",
"in-publish": "2.0.0",
"jest": "^23.1.0",
"lint-staged": "^7.2.0",
"prettier": "^1.13.5",
"pretty-bytes": "5.1.0",
"prettier": "^1.18.2",
"pretty-bytes": "5.3.0",
"prop-types": "^15.5.10",
"ramda": "^0.25.0",
"react": "^16.4.1",
"ramda": "^0.26.1",
"react": "^16.10.2",
"react-addons-test-utils": "^15.6.0",
"react-dom": "^16.4.1",
"react-test-renderer": "^16.4.1",
"readline-sync": "1.4.9",
"rimraf": "^2.6.2",
"react-dom": "^16.10.2",
"react-test-renderer": "^16.10.2",
"readline-sync": "1.4.10",
"rimraf": "^3.0.0",
"rollup": "^0.60.7",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-uglify": "^4.0.0",
"typescript": "^3.4.5",
"typescript": "^3.6.4",
"typings-tester": "^0.3.2"
},
"jest": {
Expand Down
2 changes: 2 additions & 0 deletions react-sizeme.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable */

import { Component, ComponentType, ReactNode, ReactElement } from 'react'

type Omit<T, K> = Pick<T, Exclude<keyof T, K>>
Expand Down
24 changes: 15 additions & 9 deletions src/__tests__/with-size.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ describe('withSize', () => {

describe('When using the sizeCallback fn', () => {
it('should pass the size data to the callback and pass down no size prop', () => {
const SizeAwareComponent = withSize({ monitorHeight: true })(SizeRender)
const SizeAwareComponent = withSize({
monitorHeight: true,
})(SizeRender)

class SizeCallbackWrapper extends React.Component {
state = {
Expand All @@ -148,10 +150,11 @@ describe('withSize', () => {
})

return delay(() => {
mounted.update()
expect(mounted.state()).toMatchObject({
size: { width: 100, height: 50 },
})
expect(mounted.find(SizeAwareComponent).text()).toEqual('No given size')
expect(mounted.find(SizeRender).text()).toEqual('No given size')
}, 20)
})
})
Expand Down Expand Up @@ -195,13 +198,10 @@ describe('withSize', () => {

return Promise.all([
delay(() => expect(mounted.text()).toEqual(''), 25),
delay(
() =>
expect(mounted.text()).toEqual(
expected({ width: 100, height: 50 }),
),
60,
),
delay(() => {
mounted.update()
expect(mounted.text()).toEqual(expected({ width: 100, height: 50 }))
}, 60),
])
})
})
Expand Down Expand Up @@ -230,6 +230,7 @@ describe('withSize', () => {
// Our actual component should have mounted, therefore a removelistener
// should have been called on the placeholder, and an add listener
// on the newly mounted component.
mounted.update()
expect(mounted.text()).toEqual(expected({ width: 100, height: 50 }))
expect(resizeDetectorMock.listenTo).toHaveBeenCalledTimes(2)
expect(resizeDetectorMock.uninstall).toHaveBeenCalledTimes(1)
Expand Down Expand Up @@ -299,6 +300,7 @@ describe('withSize', () => {
})

// Update should have occurred immediately.
mounted.update()
expect(mounted.text()).toEqual(expected({ width: 100 }))
})
})
Expand All @@ -323,6 +325,7 @@ describe('withSize', () => {
})

// Update should have occurred immediately.
mounted.update()
expect(mounted.text()).toEqual(expected({ height: 150 }))
})
})
Expand Down Expand Up @@ -355,6 +358,7 @@ describe('withSize', () => {
})

// Update should have occurred immediately.
mounted.update()
expect(mounted.text()).toEqual(
expected({ position: { left: 55, right: 66, top: 77, bottom: 88 } }),
)
Expand All @@ -381,6 +385,7 @@ describe('withSize', () => {
})

// Update should have occurred immediately.
mounted.update()
expect(mounted.text()).toEqual(expected({ height: 150, width: 100 }))
})
})
Expand Down Expand Up @@ -409,6 +414,7 @@ describe('withSize', () => {
}),
})

mounted.update()
expect(mounted.text()).toEqual('foo')
mounted.setProps({ otherProp: 'bar' })
expect(mounted.text()).toEqual('bar')
Expand Down
Loading

0 comments on commit 56cf111

Please sign in to comment.