11/**
22 * @typedef {import('unist').Node } Node
3+ * @typedef {import('unist').Parent } Parent
34 */
45
56import test from 'tape'
67import remark from 'remark'
78import { findAfter } from './index.js'
89
910var tree = remark ( ) . parse ( 'Some _emphasis_, **importance**, and `code`.' )
11+ /** @type {Parent } */
12+ // @ts -expect-error fine.
1013var paragraph = tree . children [ 0 ]
1114var children = paragraph . children
1215
1316test ( 'unist-util-find-after' , function ( t ) {
1417 t . throws (
1518 function ( ) {
16- // @ts -ignore runtime.
19+ // @ts -expect-error runtime.
1720 findAfter ( )
1821 } ,
1922 / E x p e c t e d p a r e n t n o d e / ,
@@ -22,7 +25,7 @@ test('unist-util-find-after', function (t) {
2225
2326 t . throws (
2427 function ( ) {
25- // @ts -ignore runtime.
28+ // @ts -expect-error runtime.
2629 findAfter ( { type : 'foo' } )
2730 } ,
2831 / E x p e c t e d p a r e n t n o d e / ,
@@ -31,7 +34,7 @@ test('unist-util-find-after', function (t) {
3134
3235 t . throws (
3336 function ( ) {
34- // @ts -ignore runtime.
37+ // @ts -expect-error runtime.
3538 findAfter ( { type : 'foo' , children : [ ] } )
3639 } ,
3740 / E x p e c t e d c h i l d n o d e o r i n d e x / ,
@@ -40,7 +43,6 @@ test('unist-util-find-after', function (t) {
4043
4144 t . throws (
4245 function ( ) {
43- // @ts -ignore runtime.
4446 findAfter ( { type : 'foo' , children : [ ] } , - 1 )
4547 } ,
4648 / 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 / ,
@@ -49,7 +51,6 @@ test('unist-util-find-after', function (t) {
4951
5052 t . throws (
5153 function ( ) {
52- // @ts -ignore runtime.
5354 findAfter ( { type : 'foo' , children : [ ] } , { type : 'bar' } )
5455 } ,
5556 / E x p e c t e d c h i l d n o d e o r i n d e x / ,
@@ -61,7 +62,7 @@ test('unist-util-find-after', function (t) {
6162 findAfter (
6263 { type : 'foo' , children : [ { type : 'bar' } , { type : 'baz' } ] } ,
6364 0 ,
64- // @ts -ignore runtime.
65+ // @ts -expect-error runtime.
6566 false
6667 )
6768 } ,
@@ -74,7 +75,7 @@ test('unist-util-find-after', function (t) {
7475 findAfter (
7576 { type : 'foo' , children : [ { type : 'bar' } , { type : 'baz' } ] } ,
7677 0 ,
77- // @ts -ignore runtime.
78+ // @ts -expect-error runtime.
7879 true
7980 )
8081 } ,
0 commit comments