summaryrefslogtreecommitdiff
path: root/tests/fixtures/test_data.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fixtures/test_data.ts')
-rw-r--r--tests/fixtures/test_data.ts63
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/fixtures/test_data.ts b/tests/fixtures/test_data.ts
new file mode 100644
index 0000000..d2143ed
--- /dev/null
+++ b/tests/fixtures/test_data.ts
@@ -0,0 +1,63 @@
+export const TRUE = true;
+export const FALSE = false;
+
+export const passphrase = "Za39PSymj5EcuzMs9kSNsAS3KbfzKHHP";
+
+export const gitDir = new URL("file:///home/user/project/");
+
+const gitLogPrettyOutput = new TextEncoder().encode([
+ "abcdef1234567890abcdef1234567890abcdef12", // long hash
+ "abcdef1", // short hash
+ "2024-06-17T12:00:00Z", // author date
+ "Alice", // author name
+ "alice@example.com", // author email
+ "2024-06-17T12:01:00Z", // committer date
+ "Bob", // committer name
+ "bob@example.com", // committer email
+ "bob@example.com", // signer
+ "ABCDEF", // key (short)
+ "ABCDEF123456", // key fingerprint (long)
+ "gpg: Signature made...", // raw line 1
+ "gpg: Good signature from...", // raw line 2
+].join("\n")) as Uint8Array<ArrayBuffer>;
+
+const gitDiffTreeOutput = new TextEncoder().encode([
+ "M\tfile.ts",
+ "A\tnew_file.ts",
+].join("\n")) as Uint8Array<ArrayBuffer>;
+
+const emptyOutput = new TextEncoder().encode("") as Uint8Array<ArrayBuffer>;
+
+export const gitLogPrettyCommandOutput: Promise<Deno.CommandOutput> = Promise
+ .resolve({
+ stdout: gitLogPrettyOutput,
+ code: 0,
+ signal: null,
+ stderr: emptyOutput,
+ success: true,
+ });
+export const gitDiffTreeCommandOutput: Promise<Deno.CommandOutput> = Promise
+ .resolve({
+ stdout: gitDiffTreeOutput,
+ code: 0,
+ signal: null,
+ stderr: emptyOutput,
+ success: true,
+ });
+export const gitRevParseCommandOutput: Promise<Deno.CommandOutput> = Promise
+ .resolve({
+ stdout: new TextEncoder().encode(gitDir.pathname) as Uint8Array<
+ ArrayBuffer
+ >,
+ code: 0,
+ signal: null,
+ stderr: emptyOutput,
+ success: true,
+ });
+export const emptyCommandOutput: Promise<Deno.CommandOutput> = Promise.resolve({
+ stdout: emptyOutput,
+ code: 0,
+ signal: null,
+ stderr: emptyOutput,
+ success: true,
+});