Skip to content

Commit

Permalink
Merge pull request #57 from snyk-tech-services/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
lili2311 authored Aug 8, 2022
2 parents 72feb3d + e590c58 commit 60fe477
Show file tree
Hide file tree
Showing 10 changed files with 716 additions and 19 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ snyk.json
snyk-prepared.json
*.bak
test/fixtures/*.json
test/lib/*.test.ts
.dccache
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@
"@snyk/dep-graph": "^1.23.0",
"@types/lodash": "^4.14.155",
"@types/node": "^14.0.12",
"axios": "0.27.2",
"debug": "^4.1.1",
"jsonq": "^1.2.0",
"lodash": "^4.17.21",
"snyk-config": "^5.0.0",
"snyk-request-manager": "1.7.1",
"snyk-request-manager": "1.8.0",
"source-map-support": "^0.5.16",
"tslib": "^1.10.0",
"typescript": "^3.9.5",
Expand Down
10 changes: 5 additions & 5 deletions src/lib/generators/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,11 @@ const generatePaginationMethods = (
url += \`?\${urlQueryParams.join("&")}\`
}
const fullResponseUserSetting = Object(this.currentContext)['fullResponse']
Object(this.currentContext)['fullResponse'] = true
try {
const firstPageResult = await requestManager.request({verb: '${
method.name
Expand Down Expand Up @@ -857,10 +857,10 @@ const generatePaginationMethods = (
if(bulkRequestArray.length>0){
bulkResultsSet = await requestManager.requestBulk(bulkRequestArray)
}
const resultsSet = [firstPageResult.data, ...bulkResultsSet.map(x=> Object(x)['data'])]
return resultsSet
} catch (err) {
Expand Down
7 changes: 3 additions & 4 deletions src/lib/generators/generateTestCases.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as fs from 'fs';
import * as _ from 'lodash';
import { type } from 'os';
import { ConsolidatedClass } from './generate';

export const generateTestCases = async (preparedJsonPath: string) => {
Expand Down Expand Up @@ -306,7 +305,7 @@ const generateTestFile = (
} - ${commandMethod.toUpperCase()}${
isPaginationMethod ? 'ALL' : ''
} method', async () => {
try {
`;

Expand All @@ -317,8 +316,8 @@ const generateTestFile = (
command[0],
isPaginationMethod,
)} = JSON.parse(fixtures.response.${commandCoordinates.join('.')})
const axiosResponse: AxiosResponse = {
data: response,
status: 200,
Expand Down
Loading

0 comments on commit 60fe477

Please sign in to comment.