1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

♻️ Refactor findeTitle()

This commit is contained in:
asmsuechan
2017-05-23 16:51:58 +09:00
parent 0f71139eba
commit 99228f2e60
2 changed files with 13 additions and 16 deletions

View File

@@ -9,9 +9,10 @@ const { findNoteTitle } = require('browser/lib/findNoteTitle')
test('findNoteTitle#find should return a correct title (string)', t => {
// [input, expected]
const testCases = [
['# hoge\nfuga', 'hoge'],
['# hoge_hoge_hoge', 'hoge_hoge_hoge'],
['```\n# hoge\n```\n# fuga', 'fuga'],
['# hoge\nfuga', '# hoge'],
['# hoge_hoge_hoge', '# hoge_hoge_hoge'],
['hoge\n====\nfuga', 'hoge'],
['====', '===='],
['```\n# hoge\n```', '```'],
['hoge', 'hoge']
]