Skip to content

Commit

Permalink
chore: Disable max-lines-per-function for tests files (#198)
Browse files Browse the repository at this point in the history
Co-authored-by: Ernesto García <gnapse@gmail.com>
  • Loading branch information
lourenci and gnapse authored Jun 17, 2020
1 parent 5e39222 commit 2449b44
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@
"extends": "./node_modules/kcd-scripts/eslint.js",
"rules": {
"babel/no-invalid-this": "off"
}
},
"overrides": [
{
"files": ["src/__tests__/*.js"],
"rules": {
"max-lines-per-function": "off"
}
}
]
},
"eslintIgnore": [
"node_modules",
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/to-be-checked.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,3 @@ describe('.toBeChecked', () => {
)
})
})

/* eslint max-lines-per-function:0 */
2 changes: 0 additions & 2 deletions src/__tests__/to-be-visible.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {render} from './helpers/test-utils'

// eslint-disable-next-line max-lines-per-function
describe('.toBeVisible', () => {
it('returns the visibility of an element', () => {
const {container} = render(`
Expand Down Expand Up @@ -36,7 +35,6 @@ describe('.toBeVisible', () => {
).toThrowError()
})

// eslint-disable-next-line max-lines-per-function
describe('with a <details /> element', () => {
let subject

Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/to-have-form-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,5 +349,3 @@ function renderSelectMultiple(name, label, options, value = []) {
function renderList(items, mapper) {
return items.map(mapper).join('')
}

/* eslint max-lines-per-function:0 */
12 changes: 5 additions & 7 deletions src/__tests__/to-have-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ describe('.toHaveValue', () => {
test('handles value of select element', () => {
const {queryByTestId} = render(`
<select data-testid="single">
<option value="first">First Value</option>
<option value="first">First Value</option>
<option value="second" selected>Second Value</option>
<option value="third">Third Value</option>
</select>
<select data-testid="multiple" multiple>
<option value="first">First Value</option>
<option value="first">First Value</option>
<option value="second" selected>Second Value</option>
<option value="third" selected>Third Value</option>
</select>
<select data-testid="not-selected" >
<option value="" disabled selected>- Select some value - </option>
<option value="first">First Value</option>
<option value="first">First Value</option>
<option value="second">Second Value</option>
<option value="third">Third Value</option>
</select>
Expand Down Expand Up @@ -204,5 +204,3 @@ describe('.toHaveValue', () => {
`)
})
})

/* eslint max-lines-per-function:0 */

0 comments on commit 2449b44

Please sign in to comment.