1
1
/**
2
2
* @typedef {import('unist').Node } Node
3
- * @typedef {import('mdast').Root } Root
4
3
*/
5
4
6
5
import assert from 'node:assert'
@@ -9,8 +8,6 @@ import {remark} from 'remark'
9
8
import { findBefore } from './index.js'
10
9
11
10
test ( 'unist-util-find-before' , ( t ) => {
12
- /** @type {Root } */
13
- // @ts -expect-error: fine.
14
11
const tree = remark ( ) . parse ( 'Some *emphasis*, **importance**, and `code`.' )
15
12
16
13
assert ( tree . type === 'root' )
@@ -23,7 +20,7 @@ test('unist-util-find-before', (t) => {
23
20
24
21
t . throws (
25
22
( ) => {
26
- // @ts -ignore runtime
23
+ // @ts -expect-error runtime
27
24
findBefore ( )
28
25
} ,
29
26
/ E x p e c t e d p a r e n t n o d e / ,
@@ -32,7 +29,7 @@ test('unist-util-find-before', (t) => {
32
29
33
30
t . throws (
34
31
( ) => {
35
- // @ts -ignore runtime
32
+ // @ts -expect-error runtime
36
33
findBefore ( { type : 'foo' } )
37
34
} ,
38
35
/ E x p e c t e d p a r e n t n o d e / ,
@@ -41,7 +38,7 @@ test('unist-util-find-before', (t) => {
41
38
42
39
t . throws (
43
40
( ) => {
44
- // @ts -ignore runtime
41
+ // @ts -expect-error runtime
45
42
findBefore ( { type : 'foo' , children : [ ] } )
46
43
} ,
47
44
/ E x p e c t e d c h i l d n o d e o r i n d e x / ,
@@ -66,7 +63,7 @@ test('unist-util-find-before', (t) => {
66
63
67
64
t . throws (
68
65
( ) => {
69
- // @ts -ignore runtime
66
+ // @ts -expect-error runtime
70
67
findBefore ( { type : 'foo' , children : [ { type : 'bar' } ] } , 1 , false )
71
68
} ,
72
69
/ E x p e c t e d f u n c t i o n , s t r i n g , o r o b j e c t a s t e s t / ,
@@ -75,7 +72,7 @@ test('unist-util-find-before', (t) => {
75
72
76
73
t . throws (
77
74
( ) => {
78
- // @ts -ignore runtime
75
+ // @ts -expect-error runtime
79
76
findBefore ( { type : 'foo' , children : [ { type : 'bar' } ] } , 1 , true )
80
77
} ,
81
78
/ E x p e c t e d f u n c t i o n , s t r i n g , o r o b j e c t a s t e s t / ,
0 commit comments