Skip to content

Commit d937b4b

Browse files
author
Bart Veneman
committed
typo + extra complexity test
1 parent 37070ca commit d937b4b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/selectors/complexity.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const fixture = `
1616
[attr],
1717
[attr=value],
1818
:where(#id, .class),
19+
:where(#a #b #c #d #e #f #g #h #i #j #k #l #m #n #o #p #q #r #s #t #u #v #w #x #y #z),
1920
main > :is(h1, h2),
2021
input[type=text]::-webkit-input-placeholder,
2122
::-webkit-scrollbar,
@@ -36,6 +37,7 @@ Complexity('calculates complexity', () => {
3637
1,
3738
2,
3839
3,
40+
52,
3941
5,
4042
5,
4143
2,
@@ -72,10 +74,11 @@ Complexity('calculates complexity uniqueness', () => {
7274
'3': 5,
7375
'4': 1,
7476
'5': 2,
77+
'52': 1,
7578
}
7679

77-
assert.is(actual.totalUnique, 5)
78-
assert.is(actual.uniquenessRatio, 5 / 15)
80+
assert.is(actual.totalUnique, 6)
81+
assert.is(actual.uniquenessRatio, 6 / 16)
7982
assert.equal(actual.unique, expected)
8083
})
8184

src/selectors/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function isAccessibility(selector) {
7676

7777
/**
7878
* Get the Complexity for the AST of a Selector Node
79-
* @param {import('css-tree').Selector} ast - AST Node for a Selector
79+
* @param {import('css-tree').Selector} selector - AST Node for a Selector
8080
* @return {[number, boolean]} - The numeric complexity of the Selector and whether it's prefixed or not
8181
*/
8282
export function getComplexity(selector) {

0 commit comments

Comments
 (0)