@@ -3,7 +3,7 @@ import { remark } from 'remark'
3
3
import find from './index.js'
4
4
5
5
test ( 'unist-find' , function ( t ) {
6
- var tree = remark ( ) . parse ( 'Some _emphasis_, **strongness**, and `code`.' )
6
+ const tree = remark ( ) . parse ( 'Some _emphasis_, **strongness**, and `code`.' )
7
7
8
8
t . throws ( function ( ) {
9
9
find ( )
@@ -14,23 +14,23 @@ test('unist-find', function (t) {
14
14
} , 'should fail without condition' )
15
15
16
16
t . test ( 'should find with string condition' , function ( st ) {
17
- var result = find ( tree , 'value' )
17
+ const result = find ( tree , 'value' )
18
18
19
19
st . equal ( result , tree . children [ 0 ] . children [ 0 ] )
20
20
21
21
st . end ( )
22
22
} )
23
23
24
24
t . test ( 'should find with object condition' , function ( st ) {
25
- var result = find ( tree , { type : 'emphasis' } )
25
+ const result = find ( tree , { type : 'emphasis' } )
26
26
27
27
st . equal ( result , tree . children [ 0 ] . children [ 1 ] )
28
28
29
29
st . end ( )
30
30
} )
31
31
32
32
t . test ( 'should find with function condition' , function ( st ) {
33
- var result = find ( tree , function ( node ) {
33
+ const result = find ( tree , function ( node ) {
34
34
return node . type === 'inlineCode'
35
35
} )
36
36
@@ -40,7 +40,7 @@ test('unist-find', function (t) {
40
40
} )
41
41
42
42
t . test ( 'should return undefined if no matches' , function ( st ) {
43
- var result = find ( tree , 'nope, nope, nope' )
43
+ const result = find ( tree , 'nope, nope, nope' )
44
44
45
45
st . equal ( result , undefined )
46
46
0 commit comments