@@ -24,11 +24,11 @@ const noPosition = retext()
24
24
. use ( retextSyntaxUrls )
25
25
26
26
test ( 'retext-syntax-urls' , ( t ) => {
27
- t . test ( 'Correct URLs' , ( st ) => {
27
+ t . test ( 'Correct URLs' , ( t ) => {
28
28
let index = - 1
29
29
while ( ++ index < correct . length ) {
30
30
const url = correct [ index ]
31
- st . doesNotThrow ( ( ) => {
31
+ t . doesNotThrow ( ( ) => {
32
32
const tree = position . parse ( 'Check out ' + url + ' it’s awesome!' )
33
33
/** @type {Source } */
34
34
// @ts -expect-error: fine.
@@ -38,15 +38,15 @@ test('retext-syntax-urls', (t) => {
38
38
} , url )
39
39
}
40
40
41
- st . end ( )
41
+ t . end ( )
42
42
} )
43
43
44
- t . test ( 'Incorrect URLs' , ( st ) => {
44
+ t . test ( 'Incorrect URLs' , ( t ) => {
45
45
let index = - 1
46
46
while ( ++ index < incorrect . length ) {
47
47
const url = incorrect [ index ]
48
48
49
- st . doesNotThrow ( ( ) => {
49
+ t . doesNotThrow ( ( ) => {
50
50
const tree = position . parse ( 'Check out ' + url + ' it’s bad!' )
51
51
52
52
visit ( tree , 'SourceNode' , ( node ) => {
@@ -55,9 +55,34 @@ test('retext-syntax-urls', (t) => {
55
55
} , url )
56
56
}
57
57
58
- st . end ( )
58
+ t . end ( )
59
59
} )
60
60
61
+ t . deepEqual (
62
+ noPosition . parse ( 'More.' ) ,
63
+ {
64
+ type : 'RootNode' ,
65
+ children : [
66
+ {
67
+ type : 'ParagraphNode' ,
68
+ children : [
69
+ {
70
+ type : 'SentenceNode' ,
71
+ children : [
72
+ {
73
+ type : 'WordNode' ,
74
+ children : [ { type : 'TextNode' , value : 'More' } ]
75
+ } ,
76
+ { type : 'PunctuationNode' , value : '.' }
77
+ ]
78
+ }
79
+ ]
80
+ }
81
+ ]
82
+ } ,
83
+ 'should support a sentence followed by eof'
84
+ )
85
+
61
86
t . end ( )
62
87
} )
63
88
0 commit comments