File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ const mdS = Md().use(anchor, {
9
9
permalinkSymbol : '#'
10
10
} )
11
11
12
- const slugifyAsserts = {
13
- /* markdown: id */
12
+ const asserts = {
13
+ /* header: slug */
14
14
'# a b' : 'a-b' ,
15
15
'# a-b' : 'a-b' ,
16
16
'# `<a>`' : 'a' ,
@@ -19,14 +19,14 @@ const slugifyAsserts = {
19
19
}
20
20
21
21
describe ( 'slugify' , ( ) => {
22
- test ( 'should convert headers correctly' , ( ) => {
23
- for ( const input in slugifyAsserts ) {
22
+ test ( 'should convert headers to slug correctly' , ( ) => {
23
+ for ( const input in asserts ) {
24
24
const output = mdS . render ( input )
25
- expect ( getHeading ( output ) ) . toBe ( slugifyAsserts [ input ] )
25
+ expect ( getSlug ( output ) ) . toBe ( asserts [ input ] )
26
26
}
27
27
} )
28
28
} )
29
29
30
- function getHeading ( output ) {
30
+ function getSlug ( output ) {
31
31
return output . match ( / i d = \\ ? " ( [ ^ " ] * ) \\ ? " / ) [ 1 ]
32
32
}
You can’t perform that action at this time.
0 commit comments