Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/plugins/custom_properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = class CustomProperties extends Diffable {
this.log.debug(`Getting all custom properties for the repo ${repoFullName}`)

const customProperties = await this.github.paginate(
this.github.rest.repos.getCustomPropertiesValues,
this.github.rest.repos.customPropertiesForReposGetRepositoryValues,
{
owner,
repo,
Expand Down Expand Up @@ -110,14 +110,14 @@ module.exports = class CustomProperties extends Diffable {
return new NopCommand(
this.constructor.name,
this.repo,
this.github.rest.repos.createOrUpdateCustomPropertiesValues.endpoint(params),
this.github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues.endpoint(params),
`${operation} Custom Property`
)
}

try {
this.log.debug(`${operation} Custom Property "${name}" for the repo ${repoFullName}`)
await this.github.rest.repos.createOrUpdateCustomPropertiesValues(params)
await this.github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues(params)
this.log.debug(`Successfully ${operation.toLowerCase()}d Custom Property "${name}" for the repo ${repoFullName}`)
} catch (e) {
this.logError(`Error during ${operation} Custom Property "${name}" for the repo ${repoFullName}: ${e.message || e}`)
Expand Down
18 changes: 9 additions & 9 deletions test/unit/lib/plugins/custom_properties.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe('CustomProperties', () => {
paginate: jest.fn(),
rest: {
repos: {
getCustomPropertiesValues: jest.fn(),
createOrUpdateCustomPropertiesValues: jest.fn()
customPropertiesForReposGetRepositoryValues: jest.fn(),
customPropertiesForReposCreateOrUpdateRepositoryValues: jest.fn()
}
}
}
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('CustomProperties', () => {
const result = await plugin.find()

expect(github.paginate).toHaveBeenCalledWith(
github.rest.repos.getCustomPropertiesValues,
github.rest.repos.customPropertiesForReposGetRepositoryValues,
{
owner,
repo,
Expand Down Expand Up @@ -100,14 +100,14 @@ describe('CustomProperties', () => {

return plugin.sync().then(() => {
expect(github.paginate).toHaveBeenCalledWith(
github.rest.repos.getCustomPropertiesValues,
github.rest.repos.customPropertiesForReposGetRepositoryValues,
{
owner,
repo,
per_page: 100
}
)
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).not.toHaveBeenCalledWith({
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).not.toHaveBeenCalledWith({
owner,
repo,
properties: [
Expand All @@ -117,7 +117,7 @@ describe('CustomProperties', () => {
}
]
})
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
owner,
repo,
properties: [
Expand All @@ -127,7 +127,7 @@ describe('CustomProperties', () => {
}
]
})
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
owner,
repo,
properties: [
Expand All @@ -137,7 +137,7 @@ describe('CustomProperties', () => {
}
]
})
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
owner,
repo,
properties: [
Expand All @@ -152,7 +152,7 @@ describe('CustomProperties', () => {
// const plugin = configure([{ name: 'Test', value: 'test' }])
// await plugin.update({ name: 'test', value: 'old' }, { name: 'test', value: 'test' })

// expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
// expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
// owner,
// repo,
// properties: [
Expand Down