-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgithub.ts
More file actions
35 lines (32 loc) · 735 Bytes
/
github.ts
File metadata and controls
35 lines (32 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class GitFile {
filename: string;
constructor(filename: string) {
this.filename = filename;
}
}
class Commit {
get data() {
return {
files: [
new GitFile('__tests__/fixtures/articles/published.md'),
new GitFile('__tests__/fixtures/articles/not-published.md'),
new GitFile('__tests__/fixtures/articles/existing-published.md'),
new GitFile('__tests__/fixtures/not-articles/file-not-included.md'),
new GitFile('some/other/path.md'),
],
};
}
}
export const context = {
repo: {info: 'foo'},
sha: '123',
};
export const getOctokit = (token: string): any => {
return {
rest: {
repos: {
getCommit: () => new Commit(),
},
},
};
};