Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
fix(breaking): update node versions (#38)
Browse files Browse the repository at this point in the history
* fix: update eslint-config, fix eslint test issues
  • Loading branch information
shazron authored Aug 15, 2023
1 parent cc70ca0 commit b686566
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 22 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"extends": ["@adobe/eslint-config-aio-lib-config"]
"extends": ["@adobe/eslint-config-aio-lib-config"],
"rules": {
"jsdoc/tag-lines": [
"error",
"never",
{
"startLines": null
}
]
}
}
4 changes: 2 additions & 2 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [14]
node-version: [16]
os: [ubuntu-latest]

steps:
Expand All @@ -29,6 +29,6 @@ jobs:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: 'Node version'
SLACK_MESSAGE: ${{ matrix.node }}
SLACK_MESSAGE: ${{ matrix.node-version }}
SLACK_COLOR: ${{ job.status == 'success' && 'good' || job.status == 'cancelled' && '#808080' || 'danger' }}

2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [14.x, 16.x]
os: [ubuntu-latest, windows-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 10
node-version: 16
- run: npm install
- run: npm test
- uses: JS-DevTools/npm-publish@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-bump-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
git config user.email grp-opensourceoffice@adobe.com
- uses: actions/setup-node@v1
with:
node-version: 10
node-version: 16
- run: |
npm install
npm test
Expand Down
8 changes: 4 additions & 4 deletions e2e/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ test('sdk init test', async () => {
expect(sdkClient.accessToken).toBe(accessToken)
})

test('test bad access token', async () => {
test('bad access token', async () => {
const _sdkClient = await sdk.init(tenantId, apiKey, 'bad_access_token')
const promise = _sdkClient.getSomething()

// just match the error message
return expect(promise).rejects.toThrow('401')
})

test('test bad api key', async () => {
test('bad api key', async () => {
const _sdkClient = await sdk.init(tenantId, 'bad_api_key', accessToken)
const promise = _sdkClient.getSomething()

// just match the error message
return expect(promise).rejects.toThrow('403')
})

test('test bad tenant id', async () => {
test('bad tenant id', async () => {
const _sdkClient = await sdk.init('bad_tenant_id', apiKey, accessToken)
const promise = _sdkClient.getSomething()

// just match the error message
return expect(promise).rejects.toThrow('500')
})

test('test getSomething API', async () => {
test('getSomething API', async () => {
// check success response
const res = await sdkClient.getSomething({ limit: 5, page: 0 })
expect(res.ok).toBeTruthy()
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
"deprecated": false,
"description": "Adobe I/O Lib",
"devDependencies": {
"@adobe/eslint-config-aio-lib-config": "^2.0.0",
"@adobe/eslint-config-aio-lib-config": "^2.0.1",
"@types/node-fetch": "^2.5.4",
"babel-runtime": "^6.26.0",
"dotenv": "^8.1.0",
"eol": "^0.9.1",
"eslint": "^8.31.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^23.20.0",
"eslint-plugin-jsdoc": "^37.9.7",
"eslint-plugin-n": "^15.6.0",
"eslint": "^8.47.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": "^4.0.0",
Expand All @@ -35,7 +35,7 @@
"openapi-schema-validator": "^3.0.3",
"stdout-stderr": "^0.1.9",
"tsd-jsdoc": "^2.4.0",
"typescript": "^4.9.4"
"typescript": "^4.9.5"
},
"homepage": "https://github.com/@adobe/aio-lib-magento",
"license": "Apache-2.0",
Expand All @@ -55,6 +55,6 @@
},
"version": "0.0.1",
"engines": {
"node": ">=10.0.0"
"node": "^14.18 || ^16.13 || >=18"
}
}
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MagentoCoreAPI {
// init swagger client
const spec = require('../spec/api.json')
const swagger = new Swagger({
spec: spec,
spec,
requestInterceptor,
responseInterceptor,
usePromise: true
Expand Down Expand Up @@ -137,5 +137,5 @@ class MagentoCoreAPI {
}
}
module.exports = {
init: init
init
}
2 changes: 1 addition & 1 deletion test/jest/mocks/swagger-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ governing permissions and limitations under the License.
/* global fixtureFile */

const mockSwaggerClient = {
...require.requireActual('swagger-client'), // we want the original implementation in there. Then we override the ones we want to mock below
...jest.requireActual('swagger-client'), // we want the original implementation in there. Then we override the ones we want to mock below
apis: {},
mockFn: function (methodName) {
const cmd = methodName.split('.')
Expand Down

0 comments on commit b686566

Please sign in to comment.