-
-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathutils.ts
More file actions
45 lines (43 loc) · 1.26 KB
/
Copy pathutils.ts
File metadata and controls
45 lines (43 loc) · 1.26 KB
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
36
37
38
39
40
41
42
43
44
45
import {Configuration} from '../src/configuration'
import {DefaultDiffInfo} from '../src/pr-collector/commits'
import {PullRequestInfo} from '../src/pr-collector/pullRequests'
import {buildChangelog} from '../src/transform'
import {BaseRepository} from '../src/repositories/BaseRepository'
import moment from 'moment'
export const buildChangelogTest = (config: Configuration, prs: PullRequestInfo[], repositoryUtils: BaseRepository): string => {
return buildChangelog(DefaultDiffInfo, prs, {
owner: 'mikepenz',
repo: 'test-repo',
fromTag: {name: '1.0.0'},
toTag: {name: '2.0.0'},
includeOpen: false,
failOnError: false,
fetchReviewers: false,
fetchReleaseInformation: false,
fetchReviews: false,
mode: 'PR',
configuration: config,
repositoryUtils
})
}
export const buildPullRequeset = (number: number, title: string, labels: string[] = ['feature']): PullRequestInfo => {
return {
number,
title,
htmlURL: '',
baseBranch: '',
createdAt: moment(),
mergedAt: moment(),
mergeCommitSha: 'sha',
author: 'Author',
repoName: 'test-repo',
labels,
milestone: '',
body: '',
assignees: [],
requestedReviewers: [],
approvedReviewers: [],
status: 'merged',
committers: []
}
}