test typing

This commit is contained in:
sam committed 2025-10-04 19:05:53 +07:00
1 parent f04ff1073e
commit a343c4a530
1 file changed
+88 -22
+88 -22
View File
@@ -57,6 +57,12 @@ describe('GitShowCommand', () => {
timestamp: 1600000000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600000000,
timezoneOffset: 0,
},
},
payload: '',
};
@@ -73,6 +79,12 @@ describe('GitShowCommand', () => {
timestamp: 1600001000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600001000,
timezoneOffset: 0,
},
},
payload: '',
};
@@ -89,6 +101,12 @@ describe('GitShowCommand', () => {
timestamp: 1600001500,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600001500,
timezoneOffset: 0,
},
},
payload: '',
};
@@ -105,6 +123,12 @@ describe('GitShowCommand', () => {
timestamp: 1600002000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600002000,
timezoneOffset: 0,
},
},
payload: '',
};
@@ -129,6 +153,12 @@ describe('GitShowCommand', () => {
timestamp: 1600000000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600000000,
timezoneOffset: 0,
},
},
payload: '',
}];
@@ -145,6 +175,12 @@ describe('GitShowCommand', () => {
timestamp: 1600001000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600001000,
timezoneOffset: 0,
},
},
payload: '',
}];
@@ -161,6 +197,12 @@ describe('GitShowCommand', () => {
timestamp: 1600001500,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600001500,
timezoneOffset: 0,
},
},
payload: '',
}];
@@ -177,6 +219,12 @@ describe('GitShowCommand', () => {
timestamp: 1600002000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600002000,
timezoneOffset: 0,
},
},
payload: '',
}];
@@ -192,36 +240,36 @@ describe('GitShowCommand', () => {
return {
oid,
tree: [
{ path: 'file1.txt', mode: '100644', oid: 'blob-initial-1' },
{ path: 'file2.txt', mode: '100644', oid: 'blob-initial-2' },
{ path: 'file1.txt', mode: '100644', type: 'blob', oid: 'blob-initial-1' },
{ path: 'file2.txt', mode: '100644', type: 'blob', oid: 'blob-initial-2' },
],
};
case 'simple-tree':
return {
oid,
tree: [
{ path: 'file1.txt', mode: '100644', oid: 'blob-modified-1' },
{ path: 'file2.txt', mode: '100644', oid: 'blob-initial-2' },
{ path: 'file3.txt', mode: '100644', oid: 'blob-new-3' },
{ path: 'file1.txt', mode: '100644', type: 'blob', oid: 'blob-modified-1' },
{ path: 'file2.txt', mode: '100644', type: 'blob', oid: 'blob-initial-2' },
{ path: 'file3.txt', mode: '100644', type: 'blob', oid: 'blob-new-3' },
],
};
case 'branch-tree':
return {
oid,
tree: [
{ path: 'file1.txt', mode: '100644', oid: 'blob-initial-1' },
{ path: 'file2.txt', mode: '100644', oid: 'blob-branch-2' },
{ path: 'binary.bin', mode: '100644', oid: 'blob-binary' },
{ path: 'file1.txt', mode: '100644', type: 'blob', oid: 'blob-initial-1' },
{ path: 'file2.txt', mode: '100644', type: 'blob', oid: 'blob-branch-2' },
{ path: 'binary.bin', mode: '100644', type: 'blob', oid: 'blob-binary' },
],
};
case 'merge-tree':
return {
oid,
tree: [
{ path: 'file1.txt', mode: '100644', oid: 'blob-modified-1' },
{ path: 'file2.txt', mode: '100644', oid: 'blob-branch-2' },
{ path: 'file3.txt', mode: '100644', oid: 'blob-new-3' },
{ path: 'binary.bin', mode: '100644', oid: 'blob-binary' },
{ path: 'file1.txt', mode: '100644', type: 'blob', oid: 'blob-modified-1' },
{ path: 'file2.txt', mode: '100644', type: 'blob', oid: 'blob-branch-2' },
{ path: 'file3.txt', mode: '100644', type: 'blob', oid: 'blob-new-3' },
{ path: 'binary.bin', mode: '100644', type: 'blob', oid: 'blob-binary' },
],
};
case 'initial-commit':
@@ -232,8 +280,8 @@ describe('GitShowCommand', () => {
return {
oid,
tree: [
{ path: 'file1.txt', mode: '100644', oid: 'blob-modified-1' },
{ path: 'file2.txt', mode: '100644', oid: 'blob-initial-2' },
{ path: 'file1.txt', mode: '100644', type: 'blob', oid: 'blob-modified-1' },
{ path: 'file2.txt', mode: '100644', type: 'blob', oid: 'blob-initial-2' },
],
};
default:
@@ -346,16 +394,16 @@ describe('GitShowCommand', () => {
return {
oid,
tree: [
{ path: 'file1.txt', mode: '100644', oid: 'blob-modified-1' },
{ path: 'file3.txt', mode: '100644', oid: 'blob-new-3' },
{ path: 'file1.txt', mode: '100644', type: 'blob', oid: 'blob-modified-1' },
{ path: 'file3.txt', mode: '100644', type: 'blob', oid: 'blob-new-3' },
],
};
} else if (oid === 'initial-commit' || oid === 'initial-tree') {
return {
oid,
tree: [
{ path: 'file1.txt', mode: '100644', oid: 'blob-initial-1' },
{ path: 'file2.txt', mode: '100644', oid: 'blob-initial-2' },
{ path: 'file1.txt', mode: '100644', type: 'blob', oid: 'blob-initial-1' },
{ path: 'file2.txt', mode: '100644', type: 'blob', oid: 'blob-initial-2' },
],
};
}
@@ -403,6 +451,12 @@ describe('GitShowCommand', () => {
timestamp: 1600001000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600001000,
timezoneOffset: 0,
},
},
payload: '',
}];
@@ -425,6 +479,12 @@ describe('GitShowCommand', () => {
timestamp: 1600001000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600001000,
timezoneOffset: 0,
},
},
payload: '',
};
@@ -441,6 +501,12 @@ describe('GitShowCommand', () => {
timestamp: 1600000000,
timezoneOffset: 0,
},
committer: {
name: 'Test User',
email: '[email protected]',
timestamp: 1600000000,
timezoneOffset: 0,
},
},
payload: '',
};
@@ -454,28 +520,28 @@ describe('GitShowCommand', () => {
return {
oid,
tree: [
{ path: 'diff-test.txt', mode: '100644', oid: 'blob-new' },
{ path: 'diff-test.txt', mode: '100644', type: 'blob', oid: 'blob-new' },
],
};
} else if (oid === 'diff-parent-tree') {
return {
oid,
tree: [
{ path: 'diff-test.txt', mode: '100644', oid: 'blob-old' },
{ path: 'diff-test.txt', mode: '100644', type: 'blob', oid: 'blob-old' },
],
};
} else if (oid === 'diff-parent-commit') {
return {
oid,
tree: [
{ path: 'diff-test.txt', mode: '100644', oid: 'blob-old' },
{ path: 'diff-test.txt', mode: '100644', type: 'blob', oid: 'blob-old' },
],
};
} else if (oid === 'diff-test-commit') {
return {
oid,
tree: [
{ path: 'diff-test.txt', mode: '100644', oid: 'blob-new' },
{ path: 'diff-test.txt', mode: '100644', type: 'blob', oid: 'blob-new' },
],
};
}