1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/development/fitness-functions/common/test-data.ts
Pedro Figueiredo 632ae0b7c3
Prevent new JS files in shared folder (#17737)
* Prevent new JS files in shared folder

* migrate to typescript

* fix types

* cleanup
2023-04-24 15:44:42 +01:00

41 lines
764 B
TypeScript

const generateCreateFileDiff = (
filePath = 'file.txt',
content = 'Lorem ipsum',
): string => `
diff --git a/${filePath} b/${filePath}
new file mode 100644
index 000000000..30d74d258
--- /dev/null
+++ b/${filePath}
@@ -0,0 +1 @@
+${content}
`;
const generateModifyFilesDiff = (
filePath = 'file.txt',
addition = 'Lorem ipsum',
removal = '',
): string => {
const additionBlock = addition
? `
@@ -1,3 +1,8 @@
+${addition}`.trim()
: '';
const removalBlock = removal
? `
@@ -34,33 +39,4 @@
-${removal}`.trim()
: '';
return `
diff --git a/${filePath} b/${filePath}
index 57d5de75c..808d8ba37 100644
--- a/${filePath}
+++ b/${filePath}
${additionBlock}
${removalBlock}`;
};
export { generateCreateFileDiff, generateModifyFilesDiff };