diff --git a/.eslintignore b/.eslintignore index f9fc9c0..bec9442 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,3 @@ node_modules build -spec/**/*.json +__tests__/**/*.json diff --git a/__tests__/report-portal-client.spec.js b/__tests__/report-portal-client.spec.js index bfcddd4..4be8d7a 100644 --- a/__tests__/report-portal-client.spec.js +++ b/__tests__/report-portal-client.spec.js @@ -249,14 +249,11 @@ describe('ReportPortal javascript client', () => { startTime: time, }); - expect(client.restClient.create).toHaveBeenCalledWith( - 'launch', - { - name: 'Test launch name', - startTime: time, - attributes: fakeSystemAttr, - } - ); + expect(client.restClient.create).toHaveBeenCalledWith('launch', { + name: 'Test launch name', + startTime: time, + attributes: fakeSystemAttr, + }); }); it('should call restClient with suitable parameters, attributes is concatenated', () => { @@ -282,21 +279,18 @@ describe('ReportPortal javascript client', () => { attributes: [{ value: 'value' }], }); - expect(client.restClient.create).toHaveBeenCalledWith( - 'launch', - { - name: 'Test launch name', - startTime: time, - attributes: [ - { value: 'value' }, - { - key: 'client', - value: 'client-name|1.0', - system: true, - }, - ], - } - ); + expect(client.restClient.create).toHaveBeenCalledWith('launch', { + name: 'Test launch name', + startTime: time, + attributes: [ + { value: 'value' }, + { + key: 'client', + value: 'client-name|1.0', + system: true, + }, + ], + }); }); it('dont start new launch if launchDataRQ.id is not empty', () => { diff --git a/__tests__/rest.spec.js b/__tests__/rest.spec.js index e40f8f5..850b8e4 100644 --- a/__tests__/rest.spec.js +++ b/__tests__/rest.spec.js @@ -47,9 +47,9 @@ describe('RestClient', () => { debug: true, }, }; - const restClient = new RestClient(optionsWithLoggerEnabled); + const client = new RestClient(optionsWithLoggerEnabled); - expect(spyLogger).toHaveBeenCalledWith(restClient.axiosInstance); + expect(spyLogger).toHaveBeenCalledWith(client.axiosInstance); }); }); diff --git a/lib/report-portal-client.js b/lib/report-portal-client.js index c24f4de..44216ea 100644 --- a/lib/report-portal-client.js +++ b/lib/report-portal-client.js @@ -718,7 +718,7 @@ class RPClient { const isItemUuid = itemUuid !== launchUuid; return this.restClient.create( url, - Object.assign(saveLogRQ, { launchUuid }, isItemUuid && { itemUuid }) + Object.assign(saveLogRQ, { launchUuid }, isItemUuid && { itemUuid }), ); }; return this.saveLog(itemObj, requestPromise); diff --git a/package.json b/package.json index 2cd6afe..cb195fe 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "npm run clean && tsc", "clean": "rimraf ./build", - "lint": "eslint ./statistics/**/* ./lib/**/* ./spec/**/*", + "lint": "eslint ./statistics/**/* ./lib/**/* ./__tests__/**/*", "format": "npm run lint -- --fix", "test": "jest", "test:coverage": "jest --coverage" diff --git a/tsconfig.json b/tsconfig.json index b5a99be..9cf199a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,6 @@ "outDir": "./build" }, "include": [ - "statistics/**/*", "lib/**/*", "spec/**/*"], + "statistics/**/*", "lib/**/*", "__tests__/**/*"], "exclude": ["node_modules"] }