Skip to content

Commit 39eddbe

Browse files
author
Moroine Bentefrit
committed
Fix tests
1 parent c893316 commit 39eddbe

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/util/propTypes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ function isSuperTypeParameterPropsDeclaration(node) {
3232
* @param {Object[]} properties Array of properties to iterate.
3333
* @param {Function} fn Function to call on each property, receives property key
3434
and property value. (key, value) => void
35+
* @param {Function} [handleSpreadFn] Function to call on each ObjectTypeSpreadProperty, receives the
36+
argument
3537
*/
3638
function iterateProperties(context, properties, fn, handleSpreadFn) {
3739
if (properties && properties.length && typeof fn === 'function') {

tests/lib/rules/no-unused-prop-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4640,7 +4640,7 @@ ruleTester.run('no-unused-prop-types', rule, {
46404640
errors: [{
46414641
message: "'unusedProp' PropType is defined but prop is never used",
46424642
line: 7,
4643-
column: 19
4643+
column: 23
46444644
}]
46454645
}, {
46464646
code: `

tests/lib/rules/prop-types.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,19 +1634,17 @@ ruleTester.run('prop-types', rule, {
16341634
parser: parsers.BABEL_ESLINT
16351635
}, {
16361636
code: [
1637-
'type Details = {',
1637+
'type OtherProps = {',
16381638
' firstname: string,',
16391639
'};',
16401640
'type Props = {',
1641-
' person: {',
1642-
' ...Details,',
1641+
' ...OtherProps,',
16431642
' lastname: string',
1644-
' }',
16451643
'};',
16461644
'class Hello extends React.Component {',
16471645
' props: Props;',
16481646
' render () {',
1649-
' return <div>Hello {this.props.person.firstname}</div>;',
1647+
' return <div>Hello {this.props.firstname}</div>;',
16501648
' }',
16511649
'}'
16521650
].join('\n'),
@@ -4791,8 +4789,8 @@ ruleTester.run('prop-types', rule, {
47914789
parser: parsers.BABEL_ESLINT,
47924790
errors: [{
47934791
message: "'notOne' is missing in props validation",
4794-
line: 8,
4795-
column: 34
4792+
line: 12,
4793+
column: 42
47964794
}]
47974795
},
47984796
{

0 commit comments

Comments
 (0)