From a6003969ffb99887c1badecaccd80a6138c860f0 Mon Sep 17 00:00:00 2001 From: Alex Nitu Date: Tue, 25 Jun 2024 10:43:58 +0300 Subject: [PATCH] fix: update test snaphsots --- test/lib/__snapshots__/org.test.ts.snap | 426 ++++++++++++------------ test/system/import:data.test.ts | 6 +- test/system/list:imported.test.ts | 8 +- 3 files changed, 220 insertions(+), 220 deletions(-) diff --git a/test/lib/__snapshots__/org.test.ts.snap b/test/lib/__snapshots__/org.test.ts.snap index b50b80aa..e34b49f9 100644 --- a/test/lib/__snapshots__/org.test.ts.snap +++ b/test/lib/__snapshots__/org.test.ts.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`listProjects list the projects in a given Org with filter - mock 1`] = ` -Object { - "org": Object { +{ + "org": { "id": "74e2f385-a54f-491e-9034-76c53e72927a", }, - "projects": Array [ - Object { + "projects": [ + { "branch": "master", "created": "2021-05-29T09:50:54.014Z", "id": "331ede0a-de94-456f-b788-166caeca58bf", @@ -20,24 +20,24 @@ Object { `; exports[`listTargets list the targets in a given Org with filter - mock 1`] = ` -Object { - "targets": Array [ - Object { - "attributes": Object { +{ + "targets": [ + { + "attributes": { "displayName": "api-import-circle-test/js-nested-manifest", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "8d7f3e14-3e31-4f56-9b9f-5100d97bexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -45,22 +45,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "api-import-circle-test/ruby-with-versions", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "6bc6d051-34a4-4883-becc-c0d658efexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -73,24 +73,24 @@ Object { `; exports[`listTargets list the targets in a given Org with pagination - mock 1`] = ` -Object { - "targets": Array [ - Object { - "attributes": Object { +{ + "targets": [ + { + "attributes": { "displayName": "api-import-circle-test/js-nested-manifest", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "8d7f3e14-3e31-4f56-9b9f-5100d97bexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -98,22 +98,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "api-import-circle-test/ruby-with-versions", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "6bc6d051-34a4-4883-becc-c0d658efexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -121,22 +121,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "antoine-snyk-demo/TestRepoAntoine", "isPrivate": true, "origin": "bitbucket-server", "remoteUrl": null, }, "id": "5f3f0648-a18c-49eb-b415-56a591afcxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -144,22 +144,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/dotnet-mixed-manifests", "isPrivate": true, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "7fab7f61-0ed9-4696-a878-8c14122b8xxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -167,22 +167,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/npm-lockfiles", "isPrivate": false, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "3300bafb-cb25-45de-9833-321b3620xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -190,22 +190,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/test-spaces", "isPrivate": true, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "1fd5033d-0e55-422f-b76e-9b25d7b9xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -213,22 +213,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "Test 105/goof.git", "isPrivate": false, "origin": "azure-repos", "remoteUrl": null, }, "id": "72ec5dcf-9982-4bfa-86aa-06e2516axxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -236,22 +236,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-fixtures/composer-with-vulns", "isPrivate": false, "origin": "github", "remoteUrl": null, }, "id": "da026d55-5ea5-47f8-a81c-86d9bf7fxxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -259,22 +259,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-fixtures/js-nested-manifest", "isPrivate": false, "origin": "github", "remoteUrl": "null", }, "id": "7fe02681-8deb-4f3b-a2d3-0c9990f7xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -282,22 +282,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "api-import-circle-test/js-nested-manifest", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "8d7f3e14-3e31-4f56-9b9f-5100d97bexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -305,22 +305,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "api-import-circle-test/ruby-with-versions", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "6bc6d051-34a4-4883-becc-c0d658efexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -328,22 +328,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "antoine-snyk-demo/TestRepoAntoine", "isPrivate": true, "origin": "bitbucket-server", "remoteUrl": null, }, "id": "5f3f0648-a18c-49eb-b415-56a591afcxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -351,22 +351,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/dotnet-mixed-manifests", "isPrivate": true, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "7fab7f61-0ed9-4696-a878-8c14122b8xxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -374,22 +374,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/npm-lockfiles", "isPrivate": false, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "3300bafb-cb25-45de-9833-321b3620xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -397,22 +397,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/test-spaces", "isPrivate": true, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "1fd5033d-0e55-422f-b76e-9b25d7b9xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -420,22 +420,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "Test 105/goof.git", "isPrivate": false, "origin": "azure-repos", "remoteUrl": null, }, "id": "72ec5dcf-9982-4bfa-86aa-06e2516axxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -443,22 +443,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-fixtures/composer-with-vulns", "isPrivate": false, "origin": "github", "remoteUrl": null, }, "id": "da026d55-5ea5-47f8-a81c-86d9bf7fxxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -466,22 +466,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-fixtures/js-nested-manifest", "isPrivate": false, "origin": "github", "remoteUrl": "null", }, "id": "7fe02681-8deb-4f3b-a2d3-0c9990f7xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -494,24 +494,24 @@ Object { `; exports[`listTargets list the targets in a given Org without pagination - mock 1`] = ` -Object { - "targets": Array [ - Object { - "attributes": Object { +{ + "targets": [ + { + "attributes": { "displayName": "api-import-circle-test/js-nested-manifest", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "8d7f3e14-3e31-4f56-9b9f-5100d97bexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -519,22 +519,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "api-import-circle-test/ruby-with-versions", "isPrivate": true, "origin": "github-enterprise", "remoteUrl": null, }, "id": "6bc6d051-34a4-4883-becc-c0d658efexxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -542,22 +542,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "antoine-snyk-demo/TestRepoAntoine", "isPrivate": true, "origin": "bitbucket-server", "remoteUrl": null, }, "id": "5f3f0648-a18c-49eb-b415-56a591afcxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -565,22 +565,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/dotnet-mixed-manifests", "isPrivate": true, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "7fab7f61-0ed9-4696-a878-8c14122b8xxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -588,22 +588,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/npm-lockfiles", "isPrivate": false, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "3300bafb-cb25-45de-9833-321b3620xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -611,22 +611,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-test-scm/test-spaces", "isPrivate": true, "origin": "bitbucket-cloud", "remoteUrl": null, }, "id": "1fd5033d-0e55-422f-b76e-9b25d7b9xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -634,22 +634,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "Test 105/goof.git", "isPrivate": false, "origin": "azure-repos", "remoteUrl": null, }, "id": "72ec5dcf-9982-4bfa-86aa-06e2516axxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -657,22 +657,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-fixtures/composer-with-vulns", "isPrivate": false, "origin": "github", "remoteUrl": null, }, "id": "da026d55-5ea5-47f8-a81c-86d9bf7fxxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, @@ -680,22 +680,22 @@ Object { }, "type": "target", }, - Object { - "attributes": Object { + { + "attributes": { "displayName": "snyk-fixtures/js-nested-manifest", "isPrivate": false, "origin": "github", "remoteUrl": "null", }, "id": "7fe02681-8deb-4f3b-a2d3-0c9990f7xxxx", - "relationships": Object { - "org": Object { - "data": Object { + "relationships": { + "org": { + "data": { "id": "e661d4ef-5ad5-4cef-ad16-5157cefa8xxx", "type": "org", }, - "links": Object { - "self": Object { + "links": { + "self": { "href": "/v3/orgs/e661d4ef-5ad5-4cef-ad16-5157cefaxxx", }, }, diff --git a/test/system/import:data.test.ts b/test/system/import:data.test.ts index 7c909e76..2feeb6d8 100644 --- a/test/system/import:data.test.ts +++ b/test/system/import:data.test.ts @@ -35,13 +35,13 @@ describe('`snyk-api-import import:data <...>`', () => { Options: --version Show version number [boolean] --help Show help [boolean] - --orgsData Path to organizations data file generated with \\"orgs:create\\" + --orgsData Path to organizations data file generated with "orgs:create" command [required] --source The source of the targets to be imported e.g. Github, Github Enterprise, Gitlab, Azure. This will be used to make an API call to list all available entities per org - [required] [choices: \\"github\\", \\"github-enterprise\\", \\"gitlab\\", \\"azure-repos\\", - \\"bitbucket-server\\", \\"bitbucket-cloud\\"] [default: \\"github\\"] + [required] [choices: "github", "github-enterprise", "gitlab", "azure-repos", + "bitbucket-server", "bitbucket-cloud"] [default: "github"] --sourceUrl Custom base url for the source API that can list organizations (e.g. Github Enterprise url)" `); diff --git a/test/system/list:imported.test.ts b/test/system/list:imported.test.ts index 5c8cf31f..e6491464 100644 --- a/test/system/list:imported.test.ts +++ b/test/system/list:imported.test.ts @@ -39,10 +39,10 @@ describe('`snyk-api-import list:imported <...>`', () => { pick the correct integrationID from each org in Snyk E.g. --integrationType=github, --integrationType=github-enterprise - [required] [choices: \\"github\\", \\"github-enterprise\\", \\"bitbucket-cloud\\", \\"gcr\\", - \\"docker-hub\\", \\"gitlab\\", \\"azure-repos\\", \\"bitbucket-server\\"] [default: - [\\"github\\",\\"github-enterprise\\",\\"bitbucket-cloud\\",\\"gcr\\",\\"docker-hub\\",\\"gitlab\\",\\"a - zure-repos\\",\\"bitbucket-server\\"]] + [required] [choices: "github", "github-enterprise", "bitbucket-cloud", "gcr", + "docker-hub", "gitlab", "azure-repos", "bitbucket-server"] [default: + ["github","github-enterprise","bitbucket-cloud","gcr","docker-hub","gitlab","a + zure-repos","bitbucket-server"]] " `); }).on('exit', (code) => {