1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-22 14:11:42 +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

@@ -20,7 +20,11 @@ test('findNoteTitle#find should return a correct title (string)', t => {
testCases.forEach(testCase => {
const [input, expected] = testCase
t.is(findNoteTitle(input, false), expected, `Test for find() input: ${input} expected: ${expected}`)
t.is(
findNoteTitle(input, false),
expected,
`Test for find() input: ${input} expected: ${expected}`
)
})
})
@@ -34,21 +38,32 @@ test('findNoteTitle#find should ignore front matter when enableFrontMatterTitle
testCases.forEach(testCase => {
const [input, expected] = testCase
t.is(findNoteTitle(input, false), expected, `Test for find() input: ${input} expected: ${expected}`)
t.is(
findNoteTitle(input, false),
expected,
`Test for find() input: ${input} expected: ${expected}`
)
})
})
test('findNoteTitle#find should respect front matter when enableFrontMatterTitle=true', t => {
// [input, expected]
const testCases = [
['---\nlayout: test\ntitle: hoge hoge hoge \n---\n# fuga', 'hoge hoge hoge'],
[
'---\nlayout: test\ntitle: hoge hoge hoge \n---\n# fuga',
'hoge hoge hoge'
],
['---\ntitle:hoge\n---\n# fuga', 'hoge'],
['title: fuga\n# hoge', '# hoge']
]
testCases.forEach(testCase => {
const [input, expected] = testCase
t.is(findNoteTitle(input, true), expected, `Test for find() input: ${input} expected: ${expected}`)
t.is(
findNoteTitle(input, true),
expected,
`Test for find() input: ${input} expected: ${expected}`
)
})
})
@@ -61,6 +76,10 @@ test('findNoteTitle#find should respect frontMatterTitleField when provided', t
testCases.forEach(testCase => {
const [input, expected] = testCase
t.is(findNoteTitle(input, true, 'custom'), expected, `Test for find() input: ${input} expected: ${expected}`)
t.is(
findNoteTitle(input, true, 'custom'),
expected,
`Test for find() input: ${input} expected: ${expected}`
)
})
})