1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-19 04:31:46 +00:00

fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)

This commit is contained in:
Nguyen Viet Hung
2020-02-05 13:28:27 +13:00
committed by GitHub
parent 051ce9e208
commit 592aca1539
186 changed files with 9233 additions and 5565 deletions

View File

@@ -261,7 +261,11 @@ this is a text
const expectedToc = testCase[2].trim()
const generatedToc = markdownToc.generate(inputMd)
t.is(generatedToc, expectedToc, `generate test : ${title} , generated : ${EOL}${generatedToc}, expected : ${EOL}${expectedToc}`)
t.is(
generatedToc,
expectedToc,
`generate test : ${title} , generated : ${EOL}${generatedToc}, expected : ${EOL}${expectedToc}`
)
})
})
@@ -279,7 +283,7 @@ test(t => {
const testCases = [
[
`***************************** Empty note, cursor at the top`,
{line: 0, ch: 0},
{ line: 0, ch: 0 },
``,
`
<!-- toc -->
@@ -291,7 +295,7 @@ test(t => {
],
[
`***************************** Two level note,TOC at the beginning `,
{line: 0, ch: 0},
{ line: 0, ch: 0 },
`
# one
this is a level one text
@@ -329,7 +333,7 @@ this is a level one text
],
[
`***************************** Two level note, cursor just after 'header text' `,
{line: 1, ch: 12},
{ line: 1, ch: 12 },
`
# header
header text
@@ -373,7 +377,7 @@ this is a level one text
],
[
`***************************** Two level note, cursor at empty line under 'header text' `,
{line: 2, ch: 0},
{ line: 2, ch: 0 },
`
# header
header text
@@ -416,7 +420,7 @@ this is a level one text
],
[
`***************************** Two level note, cursor just before 'text' word`,
{line: 1, ch: 8},
{ line: 1, ch: 8 },
`
# header
header text
@@ -461,7 +465,7 @@ this is a level one text
],
[
`***************************** Already generated TOC without header file, regenerate TOC in place, no changes`,
{line: 13, ch: 0},
{ line: 13, ch: 0 },
`
# header
header text
@@ -511,7 +515,7 @@ this is a level one text
],
[
`***************************** Already generated TOC, needs updating in place`,
{line: 0, ch: 0},
{ line: 0, ch: 0 },
`
# header
header text
@@ -561,7 +565,7 @@ this is a level one text
],
[
`***************************** Document with cursor at the last line, expecting empty TOC `,
{line: 13, ch: 30},
{ line: 13, ch: 30 },
`
# header
header text
@@ -602,7 +606,7 @@ this is a level one text
],
[
`***************************** Empty, not actual TOC , should be supplemented with two new points beneath`,
{line: 0, ch: 0},
{ line: 0, ch: 0 },
`
# header
header text
@@ -663,6 +667,10 @@ this is a level one text
editor.setCursor(cursor)
markdownToc.generateInEditor(editor)
t.is(expectedMd, editor.getValue(), `generateInEditor test : ${title} , generated : ${EOL}${editor.getValue()}, expected : ${EOL}${expectedMd}`)
t.is(
expectedMd,
editor.getValue(),
`generateInEditor test : ${title} , generated : ${EOL}${editor.getValue()}, expected : ${EOL}${expectedMd}`
)
})
})