Skip to content

🎥 Make videos programmatically with React

add test

Jonny Burger2e73a38f1aeb
diff --git a/packages/renderer/src/test/sanitize-file-path.test.ts b/packages/renderer/src/test/sanitize-file-path.test.ts
new file mode 100644
index 0000000000..899913b5d8
--- /dev/null
+++ b/packages/renderer/src/test/sanitize-file-path.test.ts
@@ -0,0 +1,16 @@
+import {sanitizeFilePath} from '../assets/sanitize-filepath';
+
+test('sanitizeFilePath linux', () => {
+ if (process.platform === 'win32') {
+ return;
+ }
+ expect(sanitizeFilePath('/path/to/path')).toBe('/path/to/path');
+ expect(sanitizeFilePath('\\path\\to\\path')).toBe('/path/to/path');
+});
+
+test('sanitizeFilePath windows', () => {
+ if (process.platform !== 'win32') {
+ return;
+ }
+ expect(sanitizeFilePath('/path/to/path')).toBe('\\path\\to\\path');
+});