File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ test('Index', function (t) {
22
22
'new Index(prop)'
23
23
)
24
24
25
- instance = new Index ( keyFn )
25
+ instance = new Index (
26
+ /**
27
+ * @param {Node & {id: string} } node
28
+ */
29
+ ( node ) => node . id
30
+ )
26
31
instance . add ( node )
27
32
28
33
t . deepEqual (
@@ -39,7 +44,7 @@ test('Index', function (t) {
39
44
'new Index(prop, tree)'
40
45
)
41
46
42
- instance = new Index ( 'id' , tree , filter )
47
+ instance = new Index ( 'id' , tree , ( node ) => node . type === 'a' )
43
48
44
49
t . deepEqual (
45
50
[ instance instanceof Index , instance . get ( 1 ) ] ,
@@ -48,16 +53,6 @@ test('Index', function (t) {
48
53
)
49
54
50
55
t . end ( )
51
-
52
- /** @type {KeyFunction } */
53
- function keyFn ( node ) {
54
- return node . id
55
- }
56
-
57
- /** @param {Node } node */
58
- function filter ( node ) {
59
- return node . type === 'a'
60
- }
61
56
} )
62
57
63
58
test ( 'index.add' , function ( t ) {
You can’t perform that action at this time.
0 commit comments