@@ -8,21 +8,21 @@ import test from 'tape'
88import remark from 'remark'
99import { findBefore } from './index.js'
1010
11- test ( 'unist-util-find-before' , function ( t ) {
11+ test ( 'unist-util-find-before' , ( t ) => {
1212 /** @type {Root } */
1313 // @ts -expect-error: fine.
14- var tree = remark ( ) . parse ( 'Some *emphasis*, **importance**, and `code`.' )
14+ const tree = remark ( ) . parse ( 'Some *emphasis*, **importance**, and `code`.' )
1515
1616 assert ( tree . type === 'root' )
17- var paragraph = tree . children [ 0 ]
17+ const paragraph = tree . children [ 0 ]
1818 assert ( paragraph . type === 'paragraph' )
19- var head = paragraph . children [ 0 ]
19+ const head = paragraph . children [ 0 ]
2020 assert ( head . type === 'text' )
21- var next = paragraph . children [ 1 ]
21+ const next = paragraph . children [ 1 ]
2222 assert ( next . type === 'emphasis' )
2323
2424 t . throws (
25- function ( ) {
25+ ( ) => {
2626 // @ts -ignore runtime
2727 findBefore ( )
2828 } ,
@@ -31,7 +31,7 @@ test('unist-util-find-before', function (t) {
3131 )
3232
3333 t . throws (
34- function ( ) {
34+ ( ) => {
3535 // @ts -ignore runtime
3636 findBefore ( { type : 'foo' } )
3737 } ,
@@ -40,7 +40,7 @@ test('unist-util-find-before', function (t) {
4040 )
4141
4242 t . throws (
43- function ( ) {
43+ ( ) => {
4444 // @ts -ignore runtime
4545 findBefore ( { type : 'foo' , children : [ ] } )
4646 } ,
@@ -49,23 +49,23 @@ test('unist-util-find-before', function (t) {
4949 )
5050
5151 t . throws (
52- function ( ) {
52+ ( ) => {
5353 findBefore ( { type : 'foo' , children : [ ] } , - 1 )
5454 } ,
5555 / E x p e c t e d p o s i t i v e f i n i t e n u m b e r a s i n d e x / ,
5656 'should fail without index (#2)'
5757 )
5858
5959 t . throws (
60- function ( ) {
60+ ( ) => {
6161 findBefore ( { type : 'foo' , children : [ ] } , { type : 'bar' } )
6262 } ,
6363 / E x p e c t e d c h i l d n o d e o r i n d e x / ,
6464 'should fail without index (#3)'
6565 )
6666
6767 t . throws (
68- function ( ) {
68+ ( ) => {
6969 // @ts -ignore runtime
7070 findBefore ( { type : 'foo' , children : [ { type : 'bar' } ] } , 1 , false )
7171 } ,
@@ -74,7 +74,7 @@ test('unist-util-find-before', function (t) {
7474 )
7575
7676 t . throws (
77- function ( ) {
77+ ( ) => {
7878 // @ts -ignore runtime
7979 findBefore ( { type : 'foo' , children : [ { type : 'bar' } ] } , 1 , true )
8080 } ,
0 commit comments