@@ -6,12 +6,12 @@ import {is} from '../index.js'
66 * @typedef {import('unist').Parent } Parent
77 */
88
9- test ( 'unist-util-is' , function ( t ) {
10- var node = { type : 'strong' }
11- var parent = { type : 'paragraph' , children : [ ] }
9+ test ( 'unist-util-is' , ( t ) => {
10+ const node = { type : 'strong' }
11+ const parent = { type : 'paragraph' , children : [ ] }
1212
1313 t . throws (
14- function ( ) {
14+ ( ) => {
1515 // @ts -ignore runtime.
1616 is ( null , false )
1717 } ,
@@ -20,23 +20,23 @@ test('unist-util-is', function (t) {
2020 )
2121
2222 t . throws (
23- function ( ) {
23+ ( ) => {
2424 is ( node , null , - 1 , parent )
2525 } ,
2626 / E x p e c t e d p o s i t i v e f i n i t e i n d e x / ,
2727 'should throw when `index` is invalid (#1)'
2828 )
2929
3030 t . throws (
31- function ( ) {
31+ ( ) => {
3232 is ( node , null , Number . POSITIVE_INFINITY , parent )
3333 } ,
3434 / E x p e c t e d p o s i t i v e f i n i t e i n d e x / ,
3535 'should throw when `index` is invalid (#2)'
3636 )
3737
3838 t . throws (
39- function ( ) {
39+ ( ) => {
4040 // @ts -ignore runtime.
4141 is ( node , null , false , parent )
4242 } ,
@@ -45,7 +45,7 @@ test('unist-util-is', function (t) {
4545 )
4646
4747 t . throws (
48- function ( ) {
48+ ( ) => {
4949 // @ts -ignore runtime.
5050 is ( node , null , 0 , { } )
5151 } ,
@@ -54,7 +54,7 @@ test('unist-util-is', function (t) {
5454 )
5555
5656 t . throws (
57- function ( ) {
57+ ( ) => {
5858 // @ts -ignore runtime.
5959 is ( node , null , 0 , { type : 'paragraph' } )
6060 } ,
@@ -63,15 +63,15 @@ test('unist-util-is', function (t) {
6363 )
6464
6565 t . throws (
66- function ( ) {
66+ ( ) => {
6767 is ( node , null , 0 )
6868 } ,
6969 / E x p e c t e d b o t h p a r e n t a n d i n d e x / ,
7070 'should throw `parent` xor `index` are given (#1)'
7171 )
7272
7373 t . throws (
74- function ( ) {
74+ ( ) => {
7575 is ( node , null , null , parent )
7676 } ,
7777 / E x p e c t e d b o t h p a r e n t a n d i n d e x / ,
@@ -89,7 +89,7 @@ test('unist-util-is', function (t) {
8989 t . ok ( is ( parent , { type : 'paragraph' } ) , 'should match partially (#3)' )
9090 t . notok ( is ( node , { type : 'paragraph' } ) , 'should match partially (#4)' )
9191
92- t . test ( 'should accept a test' , function ( t ) {
92+ t . test ( 'should accept a test' , ( t ) => {
9393 /**
9494 * @param {unknown } _
9595 * @param {number } n
@@ -106,8 +106,8 @@ test('unist-util-is', function (t) {
106106 t . end ( )
107107 } )
108108
109- t . test ( 'should invoke test' , function ( t ) {
110- var context = { foo : 'bar' }
109+ t . test ( 'should invoke test' , ( t ) => {
110+ const context = { foo : 'bar' }
111111
112112 t . plan ( 4 )
113113
@@ -130,8 +130,8 @@ test('unist-util-is', function (t) {
130130 t . ok ( is ( node , [ 'strong' , 'emphasis' ] ) , 'should match arrays (#1)' )
131131 t . notok ( is ( node , [ 'b' , 'i' ] ) , 'should match arrays (#2)' )
132132
133- t . test ( 'should match arrays (#3)' , function ( t ) {
134- var context = { foo : 'bar' }
133+ t . test ( 'should match arrays (#3)' , ( t ) => {
134+ const context = { foo : 'bar' }
135135
136136 t . plan ( 5 )
137137
0 commit comments