mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Fix lint error
This commit is contained in:
@@ -2,7 +2,7 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const { findStorage } = require('browser/lib/findStorage')
|
||||
|
||||
//TODO: ehhc: delete this
|
||||
// TODO: ehhc: delete this
|
||||
|
||||
/**
|
||||
* @description Copy an image and return the path.
|
||||
|
||||
@@ -6,7 +6,7 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const LOCAL_STORED_REGEX = /!\[(.*?)]\(\s*?\/:storage\/(.*\.\S*?)\)/gi
|
||||
//TODO: ehhc: check this -> attachmentManagement
|
||||
// TODO: ehhc: check this -> attachmentManagement
|
||||
const IMAGES_FOLDER_NAME = 'images'
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,7 +77,7 @@ function moveNote (storageKey, noteKey, newStorageKey, newFolderKey) {
|
||||
while (match != null) {
|
||||
const [, filename] = match
|
||||
const oldPath = path.join(oldStorage.path, 'images', filename)
|
||||
//TODO: ehhc: attachmentManagement
|
||||
// TODO: ehhc: attachmentManagement
|
||||
moveTasks.push(
|
||||
copyImage(oldPath, noteData.storage, false)
|
||||
.then(() => {
|
||||
|
||||
@@ -114,8 +114,8 @@ it('should test that copyAttachment don\'t uses a random file name if not intend
|
||||
})
|
||||
|
||||
it('should replace the all ":storage" path with the actual storage path', function () {
|
||||
let storageFolder = systemUnderTest.DESTINATION_FOLDER
|
||||
let testInput =
|
||||
const storageFolder = systemUnderTest.DESTINATION_FOLDER
|
||||
const testInput =
|
||||
'<html>\n' +
|
||||
' <head>\n' +
|
||||
' //header\n' +
|
||||
@@ -133,8 +133,8 @@ it('should replace the all ":storage" path with the actual storage path', functi
|
||||
' </p>\n' +
|
||||
' </body>\n' +
|
||||
'</html>'
|
||||
let storagePath = '<<dummyStoragePath>>'
|
||||
let expectedOutput =
|
||||
const storagePath = '<<dummyStoragePath>>'
|
||||
const expectedOutput =
|
||||
'<html>\n' +
|
||||
' <head>\n' +
|
||||
' //header\n' +
|
||||
@@ -152,13 +152,13 @@ it('should replace the all ":storage" path with the actual storage path', functi
|
||||
' </p>\n' +
|
||||
' </body>\n' +
|
||||
'</html>'
|
||||
let actual = systemUnderTest.fixLocalURLS(testInput, storagePath)
|
||||
const actual = systemUnderTest.fixLocalURLS(testInput, storagePath)
|
||||
expect(actual).toEqual(expectedOutput)
|
||||
})
|
||||
|
||||
it('should test that generateAttachmentMarkdown works correct both with previews and without', function () {
|
||||
let fileName = 'fileName'
|
||||
let path = 'path'
|
||||
const fileName = 'fileName'
|
||||
const path = 'path'
|
||||
let expected = ``
|
||||
let actual = systemUnderTest.generateAttachmentMarkdown(fileName, path, true)
|
||||
expect(actual).toEqual(expected)
|
||||
|
||||
Reference in New Issue
Block a user