Skip to content

Commit 16e917d

Browse files
committed
refactor: namings
1 parent c2eaff3 commit 16e917d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/markdown/slugify.spec.js

+6-6
Original file line numberDiff line numberDiff 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

2121
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) {
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(/id=\\?"([^"]*)\\?"/)[1]
3232
}

0 commit comments

Comments
 (0)