tests:fix tests error after extra github platform
This commit is contained in:
@@ -3,15 +3,16 @@ import {Octokit} from '@octokit/rest'
|
||||
import {buildChangelog} from '../src/transform'
|
||||
import {pullData} from '../src/pr-collector/prCollector'
|
||||
import {Data} from '../src/releaseNotesBuilder'
|
||||
import {GithubRepository} from "../src/repositories/GithubRepository";
|
||||
|
||||
jest.setTimeout(180000)
|
||||
|
||||
// load octokit instance
|
||||
const enablePullData = false // if false -> use cache for data
|
||||
const octokit = new Octokit({
|
||||
auth: `token ${process.env.GITHUB_TOKEN}`
|
||||
})
|
||||
|
||||
|
||||
const token = process.env.GITHUB_TOKEN || ""
|
||||
const githubRepository = new GithubRepository(token, undefined, '.')
|
||||
it('Should have empty changelog (tags)', async () => {
|
||||
const configuration = mergeConfiguration(undefined, resolveConfiguration('', 'configs/configuration.json'))
|
||||
|
||||
@@ -31,7 +32,7 @@ it('Should have empty changelog (tags)', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_0.0.2-0.0.3_cache.json')
|
||||
}
|
||||
@@ -58,7 +59,7 @@ it('Should match generated changelog (tags)', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_0.0.1-0.0.3_cache.json')
|
||||
}
|
||||
@@ -91,7 +92,7 @@ it('Should match generated changelog (refs)', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_5ec7a2-fa3788_cache.json')
|
||||
}
|
||||
@@ -131,7 +132,7 @@ it('Should match generated changelog and replace all occurrences (refs)', async
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_5ec7a2-fa3788_cache.json')
|
||||
}
|
||||
@@ -174,7 +175,7 @@ it('Should match ordered ASC', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_0.3.0-0.5.0_cache.json')
|
||||
}
|
||||
@@ -202,7 +203,7 @@ it('Should match ordered DESC', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_0.3.0-0.5.0_cache.json')
|
||||
}
|
||||
@@ -229,7 +230,7 @@ it('Should match ordered by title ASC', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_0.3.0-0.5.0_cache.json')
|
||||
}
|
||||
@@ -258,7 +259,7 @@ it('Should match ordered by title DESC', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_0.3.0-0.5.0_cache.json')
|
||||
}
|
||||
@@ -287,7 +288,7 @@ it('Should ignore PRs not merged into develop branch', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_1.3.1-1.4.0_base_develop_cache.json')
|
||||
}
|
||||
@@ -314,7 +315,7 @@ it('Should ignore PRs not merged into main branch', async () => {
|
||||
}
|
||||
let data: any
|
||||
if (enablePullData) {
|
||||
data = await pullData(octokit, options)
|
||||
data = await pullData(githubRepository, options)
|
||||
} else {
|
||||
data = checkExportedData(false, 'caches/rcba_1.3.1-1.4.0_base_main_cache.json')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user