1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Tools: Add eslint rule "jest/require-top-level-describe"

This commit is contained in:
Laurent Cozic
2023-03-08 19:08:05 +00:00
parent 19431abc73
commit 3eca4ada5a
10 changed files with 104 additions and 21 deletions

View File

@ -409,13 +409,10 @@ describe('models/Note', () => {
expect(movedNote.conflict_original_id).toBe('');
}));
});
describe('models/Note_replacePaths', () => {
function testResourceReplacment(body: string, pathsToTry: string[], expected: string) {
expect(Note['replaceResourceExternalToInternalLinks_'](pathsToTry, body)).toBe(expected);
}
test('Basic replacement', () => {
const body = '![image.png](file:///C:Users/Username/resources/849eae4dade045298c107fc706b6d2bc.png?t=1655192326803)';
const pathsToTry = ['file:///C:Users/Username/resources'];
@ -443,4 +440,5 @@ describe('models/Note_replacePaths', () => {
const expected = '![image.png](:/849eae4dade045298c107fc706b6d2bc)';
testResourceReplacment(body, pathsToTry, expected);
});
});