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:
@@ -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}`
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user