Skip to content

Commit 0e94235

Browse files
committed
Fix broken custom propertie unit test
1 parent c0bb2fd commit 0e94235

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

lib/plugins/custom_properties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = class CustomProperties extends Diffable {
2222
this.log.debug(`Getting all custom properties for the repo ${repoFullName}`)
2323

2424
const customProperties = await this.github.paginate(
25-
this.github.rest.repos.getCustomPropertiesValues,
25+
this.github.rest.repos.customPropertiesForReposGetRepositoryValues,
2626
{
2727
owner,
2828
repo,

test/unit/lib/plugins/custom_properties.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe('CustomProperties', () => {
1717
paginate: jest.fn(),
1818
rest: {
1919
repos: {
20-
getCustomPropertiesValues: jest.fn(),
21-
createOrUpdateCustomPropertiesValues: jest.fn()
20+
customPropertiesForReposGetRepositoryValues: jest.fn(),
21+
customPropertiesForReposCreateOrUpdateRepositoryValues: jest.fn()
2222
}
2323
}
2424
}
@@ -49,7 +49,7 @@ describe('CustomProperties', () => {
4949
const result = await plugin.find()
5050

5151
expect(github.paginate).toHaveBeenCalledWith(
52-
github.rest.repos.getCustomPropertiesValues,
52+
github.rest.repos.customPropertiesForReposGetRepositoryValues,
5353
{
5454
owner,
5555
repo,
@@ -100,14 +100,14 @@ describe('CustomProperties', () => {
100100

101101
return plugin.sync().then(() => {
102102
expect(github.paginate).toHaveBeenCalledWith(
103-
github.rest.repos.getCustomPropertiesValues,
103+
github.rest.repos.customPropertiesForReposGetRepositoryValues,
104104
{
105105
owner,
106106
repo,
107107
per_page: 100
108108
}
109109
)
110-
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).not.toHaveBeenCalledWith({
110+
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).not.toHaveBeenCalledWith({
111111
owner,
112112
repo,
113113
properties: [
@@ -117,7 +117,7 @@ describe('CustomProperties', () => {
117117
}
118118
]
119119
})
120-
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
120+
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
121121
owner,
122122
repo,
123123
properties: [
@@ -127,7 +127,7 @@ describe('CustomProperties', () => {
127127
}
128128
]
129129
})
130-
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
130+
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
131131
owner,
132132
repo,
133133
properties: [
@@ -137,7 +137,7 @@ describe('CustomProperties', () => {
137137
}
138138
]
139139
})
140-
expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
140+
expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
141141
owner,
142142
repo,
143143
properties: [
@@ -152,7 +152,7 @@ describe('CustomProperties', () => {
152152
// const plugin = configure([{ name: 'Test', value: 'test' }])
153153
// await plugin.update({ name: 'test', value: 'old' }, { name: 'test', value: 'test' })
154154

155-
// expect(github.rest.repos.createOrUpdateCustomPropertiesValues).toHaveBeenCalledWith({
155+
// expect(github.rest.repos.customPropertiesForReposCreateOrUpdateRepositoryValues).toHaveBeenCalledWith({
156156
// owner,
157157
// repo,
158158
// properties: [

0 commit comments

Comments
 (0)