mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Read/Write Files from Disk Node): Escape parenthesis when reading file (#11753)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { escapeSpecialCharacters } from '../helpers/utils';
|
||||
|
||||
describe('Read/Write Files from Disk, escapeSpecialCharacters', () => {
|
||||
it('should escape parentheses in a string', () => {
|
||||
const input = '/home/michael/Desktop/test(1).txt';
|
||||
const expectedOutput = '/home/michael/Desktop/test\\(1\\).txt';
|
||||
expect(escapeSpecialCharacters(input)).toBe(expectedOutput);
|
||||
});
|
||||
|
||||
it('should not modify strings that do not contain parentheses', () => {
|
||||
const input = '/home/michael/Desktop/test.txt';
|
||||
const expectedOutput = '/home/michael/Desktop/test.txt';
|
||||
expect(escapeSpecialCharacters(input)).toBe(expectedOutput);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user