Skip to content

Commit e29d746

Browse files
author
David-Pena
committed
chore: add failing test to parameterCount for #365
1 parent 6a12a8e commit e29d746

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/rules/rrd/parameterCount.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@ describe('checkParameterCount', () => {
2222
expect(result).toStrictEqual([])
2323
})
2424

25+
it.todo('should not report files where functions do not exceed the recommended limit with destructuring', () => {
26+
const script = {
27+
content: `
28+
<script setup>
29+
function dummyFuncOne({ param1, param2, param3, param4, param5 }) {
30+
return 'One'
31+
}
32+
33+
const dummyFuncTwo = ({ param1, param2, param3, param4 }) => {
34+
return 'Two'
35+
}
36+
</script>
37+
`,
38+
} as SFCScriptBlock
39+
const filename = 'destructuring-parameters.vue'
40+
const maxParameterCount = DEFAULT_OVERRIDE_CONFIG.maxParameterCount
41+
checkParameterCount(script, filename, maxParameterCount)
42+
const result = reportParameterCount(maxParameterCount)
43+
expect(result.length).toBe(0)
44+
expect(result).toStrictEqual([])
45+
})
46+
2547
it('should report files where one function exceeds the recommended limit', () => {
2648
const script = {
2749
content: `

0 commit comments

Comments
 (0)