Skip to content

Commit

Permalink
chore: add failing test to parameterCount for #365
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Pena committed Sep 30, 2024
1 parent 6a12a8e commit e29d746
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/rules/rrd/parameterCount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ describe('checkParameterCount', () => {
expect(result).toStrictEqual([])
})

it.todo('should not report files where functions do not exceed the recommended limit with destructuring', () => {
const script = {
content: `
<script setup>
function dummyFuncOne({ param1, param2, param3, param4, param5 }) {
return 'One'
}
const dummyFuncTwo = ({ param1, param2, param3, param4 }) => {
return 'Two'
}
</script>
`,
} as SFCScriptBlock
const filename = 'destructuring-parameters.vue'
const maxParameterCount = DEFAULT_OVERRIDE_CONFIG.maxParameterCount
checkParameterCount(script, filename, maxParameterCount)
const result = reportParameterCount(maxParameterCount)
expect(result.length).toBe(0)
expect(result).toStrictEqual([])
})

it('should report files where one function exceeds the recommended limit', () => {
const script = {
content: `
Expand Down

0 comments on commit e29d746

Please sign in to comment.