@@ -12,8 +12,8 @@ describe('MarkdownLink', () => {
12
12
. links [ 0 ] ;
13
13
const parsed = MarkdownLink . analyzeLink ( link ) ;
14
14
expect ( parsed . target ) . toEqual ( 'wikilink' ) ;
15
- expect ( parsed . section ) . toBeUndefined ( ) ;
16
- expect ( parsed . alias ) . toBeUndefined ( ) ;
15
+ expect ( parsed . section ) . toEqual ( '' ) ;
16
+ expect ( parsed . alias ) . toEqual ( '' ) ;
17
17
} ) ;
18
18
it ( 'should parse target and section' , ( ) => {
19
19
const link = parser . parse (
@@ -23,14 +23,14 @@ describe('MarkdownLink', () => {
23
23
const parsed = MarkdownLink . analyzeLink ( link ) ;
24
24
expect ( parsed . target ) . toEqual ( 'wikilink' ) ;
25
25
expect ( parsed . section ) . toEqual ( 'section' ) ;
26
- expect ( parsed . alias ) . toBeUndefined ( ) ;
26
+ expect ( parsed . alias ) . toEqual ( '' ) ;
27
27
} ) ;
28
28
it ( 'should parse target and alias' , ( ) => {
29
29
const link = parser . parse ( getRandomURI ( ) , `this is a [[wikilink|alias]]` )
30
30
. links [ 0 ] ;
31
31
const parsed = MarkdownLink . analyzeLink ( link ) ;
32
32
expect ( parsed . target ) . toEqual ( 'wikilink' ) ;
33
- expect ( parsed . section ) . toBeUndefined ( ) ;
33
+ expect ( parsed . section ) . toEqual ( '' ) ;
34
34
expect ( parsed . alias ) . toEqual ( 'alias' ) ;
35
35
} ) ;
36
36
it ( 'should parse links with square brackets #975' , ( ) => {
@@ -40,8 +40,8 @@ describe('MarkdownLink', () => {
40
40
) . links [ 0 ] ;
41
41
const parsed = MarkdownLink . analyzeLink ( link ) ;
42
42
expect ( parsed . target ) . toEqual ( 'wikilink [with] brackets' ) ;
43
- expect ( parsed . section ) . toBeUndefined ( ) ;
44
- expect ( parsed . alias ) . toBeUndefined ( ) ;
43
+ expect ( parsed . section ) . toEqual ( '' ) ;
44
+ expect ( parsed . alias ) . toEqual ( '' ) ;
45
45
} ) ;
46
46
it ( 'should parse links with square brackets in alias #975' , ( ) => {
47
47
const link = parser . parse (
@@ -50,7 +50,7 @@ describe('MarkdownLink', () => {
50
50
) . links [ 0 ] ;
51
51
const parsed = MarkdownLink . analyzeLink ( link ) ;
52
52
expect ( parsed . target ) . toEqual ( 'wikilink' ) ;
53
- expect ( parsed . section ) . toBeUndefined ( ) ;
53
+ expect ( parsed . section ) . toEqual ( '' ) ;
54
54
expect ( parsed . alias ) . toEqual ( 'alias [with] brackets' ) ;
55
55
} ) ;
56
56
it ( 'should parse target and alias with escaped separator' , ( ) => {
@@ -60,7 +60,7 @@ describe('MarkdownLink', () => {
60
60
) . links [ 0 ] ;
61
61
const parsed = MarkdownLink . analyzeLink ( link ) ;
62
62
expect ( parsed . target ) . toEqual ( 'wikilink' ) ;
63
- expect ( parsed . section ) . toBeUndefined ( ) ;
63
+ expect ( parsed . section ) . toEqual ( '' ) ;
64
64
expect ( parsed . alias ) . toEqual ( 'alias' ) ;
65
65
} ) ;
66
66
it ( 'should parse target section and alias' , ( ) => {
@@ -77,9 +77,9 @@ describe('MarkdownLink', () => {
77
77
const link = parser . parse ( getRandomURI ( ) , `this is a [[#section]]` )
78
78
. links [ 0 ] ;
79
79
const parsed = MarkdownLink . analyzeLink ( link ) ;
80
- expect ( parsed . target ) . toBeUndefined ( ) ;
80
+ expect ( parsed . target ) . toEqual ( '' ) ;
81
81
expect ( parsed . section ) . toEqual ( 'section' ) ;
82
- expect ( parsed . alias ) . toBeUndefined ( ) ;
82
+ expect ( parsed . alias ) . toEqual ( '' ) ;
83
83
} ) ;
84
84
} ) ;
85
85
@@ -89,7 +89,7 @@ describe('MarkdownLink', () => {
89
89
. links [ 0 ] ;
90
90
const parsed = MarkdownLink . analyzeLink ( link ) ;
91
91
expect ( parsed . target ) . toEqual ( 'to/path.md' ) ;
92
- expect ( parsed . section ) . toBeUndefined ( ) ;
92
+ expect ( parsed . section ) . toEqual ( '' ) ;
93
93
expect ( parsed . alias ) . toEqual ( 'link' ) ;
94
94
} ) ;
95
95
it ( 'should parse target and section' , ( ) => {
@@ -109,7 +109,7 @@ describe('MarkdownLink', () => {
109
109
range : Range . create ( 0 , 0 ) ,
110
110
} ;
111
111
const parsed = MarkdownLink . analyzeLink ( link ) ;
112
- expect ( parsed . target ) . toBeUndefined ( ) ;
112
+ expect ( parsed . target ) . toEqual ( '' ) ;
113
113
expect ( parsed . section ) . toEqual ( 'section' ) ;
114
114
expect ( parsed . alias ) . toEqual ( 'link' ) ;
115
115
} ) ;
@@ -120,17 +120,15 @@ describe('MarkdownLink', () => {
120
120
) . links [ 0 ] ;
121
121
const parsed = MarkdownLink . analyzeLink ( link ) ;
122
122
expect ( parsed . target ) . toEqual ( 'to/path.md' ) ;
123
- expect ( parsed . section ) . toBeUndefined ( ) ;
123
+ expect ( parsed . section ) . toEqual ( '' ) ;
124
124
expect ( parsed . alias ) . toEqual ( 'inbox [xyz]' ) ;
125
125
} ) ;
126
- it ( 'should parse links with empty label #975' , ( ) => {
127
- const link = parser . parse (
128
- getRandomURI ( ) ,
129
- `this is a [](to/path.md)`
130
- ) . links [ 0 ] ;
126
+ it ( 'should parse links with empty label #975' , ( ) => {
127
+ const link = parser . parse ( getRandomURI ( ) , `this is a [](to/path.md)` )
128
+ . links [ 0 ] ;
131
129
const parsed = MarkdownLink . analyzeLink ( link ) ;
132
130
expect ( parsed . target ) . toEqual ( 'to/path.md' ) ;
133
- expect ( parsed . section ) . toBeUndefined ( ) ;
131
+ expect ( parsed . section ) . toEqual ( '' ) ;
134
132
expect ( parsed . alias ) . toEqual ( '' ) ;
135
133
} ) ;
136
134
} ) ;
0 commit comments