Skip to content

Commit

Permalink
Bump @adobe/aio-lib-core-config from 3.1.0 to 4.0.0 (#75)
Browse files Browse the repository at this point in the history
* Bump @adobe/aio-lib-core-config from 3.1.0 to 4.0.0

Bumps [@adobe/aio-lib-core-config](https://github.com/adobe/aio-lib-core-config) from 3.1.0 to 4.0.0.
- [Release notes](https://github.com/adobe/aio-lib-core-config/releases)
- [Commits](adobe/aio-lib-core-config@3.1.0...4.0.0)

---
updated-dependencies:
- dependency-name: "@adobe/aio-lib-core-config"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: update eslint-config, fix eslint test issues

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shazron Abdullah <36107+shazron@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and shazron authored Aug 14, 2023
1 parent 17e92e2 commit dc811bf
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 105 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@
"jsdoc": {
"ignorePrivate": true
}
},
"rules": {
"jsdoc/tag-lines": [
// The Error level should be `error`, `warn`, or `off` (or 2, 1, or 0)
"error",
"never",
{
"startLines": null
}
]
}
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "Apache-2.0",
"dependencies": {
"@adobe/aio-lib-console": "^4.0.0",
"@adobe/aio-lib-core-config": "^3.0.0",
"@adobe/aio-lib-core-config": "^4.0.0",
"@adobe/aio-lib-core-logging": "^2.0.0",
"@adobe/aio-lib-events": "^3.1.0",
"@adobe/aio-lib-ims": "^6.0.1",
Expand All @@ -19,19 +19,19 @@
},
"repository": "adobe/aio-cli-plugin-events",
"devDependencies": {
"@adobe/eslint-config-aio-lib-config": "^2.0.0",
"@adobe/eslint-config-aio-lib-config": "^2.0.1",
"@types/jest": "^29.5.3",
"acorn": "^8.10.0",
"babel-runtime": "^6.26.0",
"chalk": "^4.0.0",
"eol": "^0.9.1",
"eslint": "^8.38.0",
"eslint": "^8.47.0",
"eslint-config-oclif": "^3.1.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^23.20.0",
"eslint-plugin-jsdoc": "^37.9.7",
"eslint-plugin-n": "^15.7.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsdoc": "^42.0.0",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-standard": "^5.0.0",
Expand All @@ -42,7 +42,7 @@
"jest-resolve": "^29.5.0",
"oclif": "^3.2.0",
"stdout-stderr": "^0.1.13",
"typescript": "^5.0.4"
"typescript": "^5.1.6"
},
"engines": {
"node": "^14.18 || ^16.13 || >=18"
Expand Down
8 changes: 4 additions & 4 deletions test/commands/event/eventmetadata/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,21 @@ describe('console:eventmetadata:create', () => {
test('should create an event metadata and return response', async () => {
command.argv = ['providerId']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', event_code: 'come.adobe.CODE01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/create.txt')
})

test('should create an event metadata and return response as json', async () => {
command.argv = ['providerId', '--json']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', event_code: 'come.adobe.CODE01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(JSON.parse(stdout.output)).toMatchFixtureJson('eventmetadata/create.json')
})

test('should create an event metadata and return response as yaml', async () => {
command.argv = ['providerId', '--yml']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', event_code: 'come.adobe.CODE01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/create.yml')
})
})
Expand All @@ -113,7 +113,7 @@ describe('console:eventmetadata:create', () => {
test('should return error on create event metadata', async () => {
command.argv = ['providerId']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', event_code: 'come.adobe.CODE01' })
await expect(command.run()).rejects.toThrowError(new Error('Error creating event metadata'))
await expect(command.run()).rejects.toThrow(new Error('Error creating event metadata'))
})
})
})
12 changes: 6 additions & 6 deletions test/commands/event/eventmetadata/delete.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,27 @@ describe('console:eventmetadata:delete', () => {
command.argv = ['providerId']
command.eventClient = { deleteAllEventMetadata: jest.fn().mockReturnValue('OK') }
inquirer.prompt.mockResolvedValueOnce({ delete: true })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toBe('All event metadata of provider providerId has been deleted successfully\n')
})
test('should delete one event metadata', async () => {
command.argv = ['providerId', 'com.adobe.CODE01']
command.eventClient = { deleteEventMetadata: jest.fn().mockReturnValue('OK') }
inquirer.prompt.mockResolvedValueOnce({ delete: true })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toBe('com.adobe.CODE01 event metadata of provider providerId has been deleted successfully\n')
})

test('cancel delete all event metadata', async () => {
command.argv = ['providerId']
inquirer.prompt.mockResolvedValueOnce({ delete: false })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toBe('Deletion operation has been cancelled. For more information on delete use --help\n')
})
test('cancel delete one event metadata', async () => {
command.argv = ['providerId', 'com.adobe.CODE01']
inquirer.prompt.mockResolvedValueOnce({ delete: false })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toBe('Deletion operation has been cancelled. For more information on delete use --help\n')
})
})
Expand All @@ -115,14 +115,14 @@ describe('console:eventmetadata:delete', () => {
command.argv = ['providerId']
inquirer.prompt.mockResolvedValueOnce({ delete: true })
command.eventClient = { deleteAllEventMetadata: jest.fn().mockRejectedValue('Error deleting all event metadata') }
await expect(command.run()).rejects.toThrowError(new Error('Error deleting all event metadata'))
await expect(command.run()).rejects.toThrow(new Error('Error deleting all event metadata'))
})

test('should return error on delete one event metadata', async () => {
command.argv = ['providerId', 'com.adobe.CODE01']
command.eventClient = { deleteEventMetadata: jest.fn().mockRejectedValue('Error deleting event metadata') }
inquirer.prompt.mockResolvedValueOnce({ delete: true })
await expect(command.run()).rejects.toThrowError(new Error('Error deleting event metadata'))
await expect(command.run()).rejects.toThrow(new Error('Error deleting event metadata'))
})
})
})
8 changes: 4 additions & 4 deletions test/commands/event/eventmetadata/get.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ describe('console:eventmetadata:get', () => {
})

test('should return am event metadata', async () => {
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/get.txt')
})

test('should return event metadata as json', async () => {
command.argv = ['providerId', 'com.adobe.CODE01', '--json']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(JSON.parse(stdout.output)).toMatchFixtureJson('eventmetadata/get.json')
})

test('should return event metadata as yaml', async () => {
command.argv = ['providerId', 'com.adobe.CODE01', '--yml']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/get.yml')
})
})
Expand All @@ -98,7 +98,7 @@ describe('console:eventmetadata:get', () => {

test('should return error on get event metadata', async () => {
command.argv = ['providerId', 'com.adobe.CODE01']
await expect(command.run()).rejects.toThrowError(new Error('Error retrieving event metadata'))
await expect(command.run()).rejects.toThrow(new Error('Error retrieving event metadata'))
})
})
})
8 changes: 4 additions & 4 deletions test/commands/event/eventmetadata/list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ describe('console:eventmetadata:list', () => {

test('should return list of event metadata', async () => {
command.argv = ['providerId']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/list.txt')
})

test('should return list of event metadata as json', async () => {
command.argv = ['providerId', '--json']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(JSON.parse(stdout.output)).toMatchFixtureJson('eventmetadata/list.json')
})

test('should return list of event metadata as yaml', async () => {
command.argv = ['providerId', '--yml']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/list.yml')
})
})
Expand All @@ -95,7 +95,7 @@ describe('console:eventmetadata:list', () => {

test('should return error on get list of event metadata', async () => {
command.argv = ['providerId']
await expect(command.run()).rejects.toThrowError(new Error('Error retrieving event metadata'))
await expect(command.run()).rejects.toThrow(new Error('Error retrieving event metadata'))
})
})
})
8 changes: 4 additions & 4 deletions test/commands/event/eventmetadata/update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ describe('console:eventmetadata:update', () => {
test('should update an event metadata and return response', async () => {
command.argv = ['providerId', 'com.adobe.CODE01']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL04', description: 'DESC04', docs_url: 'DOCS01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/update.txt')
})

test('should update an event metadata and return response as json', async () => {
command.argv = ['providerId', 'com.adobe.CODE01', '--json']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL04', description: 'DESC04', docs_url: 'DOCS01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(JSON.parse(stdout.output)).toMatchFixtureJson('eventmetadata/update.json')
})

test('should update a provider and return response as yaml', async () => {
command.argv = ['providerId', 'com.adobe.CODE01', '--yml']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL04', description: 'DESC04', docs_url: 'DOCS01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('eventmetadata/update.yml')
})
})
Expand All @@ -115,7 +115,7 @@ describe('console:eventmetadata:update', () => {
test('should return error on update provider', async () => {
command.argv = ['providerId', 'com.adobe.CODE01']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL04', description: 'DESC04', docs_url: 'DOCS01' })
await expect(command.run()).rejects.toThrowError(new Error('Error updating event metadata'))
await expect(command.run()).rejects.toThrow(new Error('Error updating event metadata'))
})
})
})
10 changes: 5 additions & 5 deletions test/commands/event/provider/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,28 @@ describe('console:provider:create', () => {

test('should create a provider and return response', async () => {
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', docs_url: 'DOCS01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('provider/create.txt')
})

test('should create a provider and return response for empty desc and docs', async () => {
command.eventClient = { createProvider: jest.fn().mockReturnValue(mock.data.createProviderWithoutDescAndDocsUrlResponse) }
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: '', docs_url: '' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('provider/emptyDescCreate.txt')
})

test('should create a provider and return response as json', async () => {
command.argv = ['--json']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', docs_url: 'DOCS01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(JSON.parse(stdout.output)).toMatchFixtureJson('provider/create.json')
})

test('should create a provider and return response as yaml', async () => {
command.argv = ['--yml']
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', docs_url: 'DOCS01' })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('provider/create.yml')
})
})
Expand All @@ -117,7 +117,7 @@ describe('console:provider:create', () => {

test('should return error on create provider', async () => {
inquirer.prompt.mockResolvedValueOnce({ label: 'LABEL01', description: 'DESC01', docs_url: 'DOCS01' })
await expect(command.run()).rejects.toThrowError(new Error('Error creating provider'))
await expect(command.run()).rejects.toThrow(new Error('Error creating provider'))
})
})
})
6 changes: 3 additions & 3 deletions test/commands/event/provider/delete.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ describe('console:provider:delete', () => {
test('should delete provider', async () => {
command.argv = ['providerId']
inquirer.prompt.mockResolvedValueOnce({ delete: true })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toBe('Provider providerId has been deleted successfully\n')
})

test('cancel delete provider', async () => {
command.argv = ['providerId']
inquirer.prompt.mockResolvedValueOnce({ delete: false })
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toBe('Delete operation has been cancelled\n')
})
})
Expand All @@ -101,7 +101,7 @@ describe('console:provider:delete', () => {
test('should return error on delete provider', async () => {
command.argv = ['providerId']
inquirer.prompt.mockResolvedValueOnce({ delete: true })
await expect(command.run()).rejects.toThrowError(new Error('Error deleting provider'))
await expect(command.run()).rejects.toThrow(new Error('Error deleting provider'))
})
})
})
8 changes: 4 additions & 4 deletions test/commands/event/provider/get.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ describe('console:provider:get', () => {
})

test('should return a provider', async () => {
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('provider/get.txt')
})

test('should return provider as json', async () => {
command.argv = ['providerId', '--json']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(JSON.parse(stdout.output)).toMatchFixtureJson('provider/get.json')
})

test('should return provider as yaml', async () => {
command.argv = ['providerId', '--yml']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('provider/get.yml')
})
})
Expand All @@ -97,7 +97,7 @@ describe('console:provider:get', () => {

test('should return error on get provider', async () => {
command.argv = ['providerId']
await expect(command.run()).rejects.toThrowError(new Error('Error retrieving provider'))
await expect(command.run()).rejects.toThrow(new Error('Error retrieving provider'))
})
})
})
14 changes: 7 additions & 7 deletions test/commands/event/provider/list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,25 @@ describe('console:provider:list', () => {
})

test('should return list of providers', async () => {
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('provider/list.txt')
})

test('should return list of providers as json', async () => {
command.argv = ['--json']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(JSON.parse(stdout.output)).toMatchFixtureJson('provider/list.json')
})

test('should return list of providers as yaml', async () => {
command.argv = ['--yml']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(stdout.output).toMatchFixture('provider/list.yml')
})

test('should return list of providers with event metadata', async () => {
command.argv = ['--fetchEventMetadata']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(command.eventClient.getAllProviders).toHaveBeenCalledWith(ORG_ID, {
fetchEventMetadata: true,
filterBy: {
Expand All @@ -102,7 +102,7 @@ describe('console:provider:list', () => {

test('should return providers for provider metadata id and instance id', async () => {
command.argv = ['--providerMetadataId', 'pm-1', '--instanceId', 'instance1']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(command.eventClient.getAllProviders).toHaveBeenCalledWith(ORG_ID, {
fetchEventMetadata: undefined,
filterBy: {
Expand All @@ -115,7 +115,7 @@ describe('console:provider:list', () => {

test('should return list of providers for provider metadata id list', async () => {
command.argv = ['--providerMetadataIds', 'pm-1', 'pm-2']
await expect(command.run()).resolves.not.toThrowError()
await expect(command.run()).resolves.not.toThrow()
expect(command.eventClient.getAllProviders).toHaveBeenCalledWith(ORG_ID, {
fetchEventMetadata: undefined,
filterBy: {
Expand All @@ -139,7 +139,7 @@ describe('console:provider:list', () => {
})

test('should return error on get list of providers', async () => {
await expect(command.run()).rejects.toThrowError(new Error('Error retrieving providers'))
await expect(command.run()).rejects.toThrow(new Error('Error retrieving providers'))
})

test('should return error on passing both providerMetadataId and providerMetadataIds flags', async () => {
Expand Down
Loading

0 comments on commit dc811bf

Please sign in to comment.