File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 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, {
99 permalinkSymbol : '#'
1010} )
1111
12- const slugifyAsserts = {
13- /* markdown: id */
12+ const asserts = {
13+ /* header: slug */
1414 '# a b' : 'a-b' ,
1515 '# a-b' : 'a-b' ,
1616 '# `<a>`' : 'a' ,
@@ -19,14 +19,14 @@ const slugifyAsserts = {
1919}
2020
2121describe ( '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 ) {
2424 const output = mdS . render ( input )
25- expect ( getHeading ( output ) ) . toBe ( slugifyAsserts [ input ] )
25+ expect ( getSlug ( output ) ) . toBe ( asserts [ input ] )
2626 }
2727 } )
2828} )
2929
30- function getHeading ( output ) {
30+ function getSlug ( output ) {
3131 return output . match ( / i d = \\ ? " ( [ ^ " ] * ) \\ ? " / ) [ 1 ]
3232}
You can’t perform that action at this time.
0 commit comments