diff --git a/lib/plugins/custom_properties.js b/lib/plugins/custom_properties.js index 35f0144da..02a2540b9 100644 --- a/lib/plugins/custom_properties.js +++ b/lib/plugins/custom_properties.js @@ -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, @@ -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}`) diff --git a/test/unit/lib/plugins/custom_properties.test.js b/test/unit/lib/plugins/custom_properties.test.js index a9e878d58..7642e8f58 100644 --- a/test/unit/lib/plugins/custom_properties.test.js +++ b/test/unit/lib/plugins/custom_properties.test.js @@ -17,8 +17,8 @@ describe('CustomProperties', () => { paginate: jest.fn(), rest: { repos: { - getCustomPropertiesValues: jest.fn(), - createOrUpdateCustomPropertiesValues: jest.fn() + customPropertiesForReposGetRepositoryValues: jest.fn(), + customPropertiesForReposCreateOrUpdateRepositoryValues: jest.fn() } } } @@ -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, @@ -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: [ @@ -117,7 +117,7 @@ describe('CustomProperties', () => { } ] }) - expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({ + expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({ owner, repo, properties: [ @@ -127,7 +127,7 @@ describe('CustomProperties', () => { } ] }) - expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({ + expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({ owner, repo, properties: [ @@ -137,7 +137,7 @@ describe('CustomProperties', () => { } ] }) - expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({ + expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({ owner, repo, properties: [ @@ -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: [