Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: aggregate data regarding API types and versions usage #1580

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tatomyr
Copy link
Contributor

@tatomyr tatomyr commented Jun 4, 2024

What/Why/How?

Aggregate data regarding API types and versions usage.

Important: it's better to wait until #1493 is merged. Otherwise could run into multiple merge conflicts.

Reference

Resolves #1297

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Copy link

changeset-bot bot commented Jun 4, 2024

⚠️ No Changeset found

Latest commit: 1d5801c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jun 4, 2024

Coverage report

Multiple errors occurred

 1 | Error: The process '/opt/hostedtoolcache/node/20.15.1/x64/bin/npm' failed with exit code 2
 2 | Error: The process '/opt/hostedtoolcache/node/20.15.1/x64/bin/npm' failed with exit code 1
St.
Category Percentage Covered / Total
🟡 Statements
68.67% (-8.56% 🔻)
4081/5943
🔴 Branches
58.67% (-8.46% 🔻)
2233/3806
🟡 Functions
62.29% (-8.32% 🔻)
664/1066
🟡 Lines
68.6% (-8.9% 🔻)
3825/5576
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 core/src/lint.ts 95.74%
81.82% (-1.52% 🔻)
100% 95.65%
🟡
... / miscellaneous.ts
62.2% (-1.57% 🔻)
50.75%
66.67% (-5.26% 🔻)
61.85% (-1.61% 🔻)
🔴
... / push.ts
23.84% (-49.69% 🔻)
22.31% (-46.15% 🔻)
27.27% (-27.27% 🔻)
24.69% (-51.23% 🔻)
🔴
... / push.ts
15.71% (-71.43% 🔻)
0% (-58.33% 🔻)
10% (-90% 🔻)
16.18% (-70.59% 🔻)
🔴
... / push-status.ts
14.46% (-77.11% 🔻)
0% (-77.27% 🔻)
7.14% (-92.86% 🔻)
14.46% (-77.11% 🔻)
🔴
... / js-utils.ts
33.33% (-53.33% 🔻)
0% (-81.82% 🔻)
0% (-100% 🔻)
35.71% (-57.14% 🔻)
🟢
... / utils.ts
92.86% (-7.14% 🔻)
81.25% (-6.25% 🔻)
100%
92.86% (-7.14% 🔻)
🔴
... / join.ts
4.72% (-64.15% 🔻)
0% (-54.7% 🔻)
2.08% (-64.58% 🔻)
4.93% (-65.46% 🔻)
🔴
... / index.ts
23.17% (-44.31% 🔻)
13.95% (-44.45% 🔻)
11.11% (-74.07% 🔻)
24.68% (-45.91% 🔻)
🟢 cli/src/wrapper.ts
80% (-20% 🔻)
21.21% (-78.79% 🔻)
80% (-20% 🔻)
82.14% (-17.86% 🔻)
🟢
... / bundle.ts
86.27% 71.79% 100% 86.27%
🔴
... / index.ts
46.15% (-49.85% 🔻)
0% (-60% 🔻)
100%
44% (-51.65% 🔻)
🟡
... / utils.ts
65.12% (-4.65% 🔻)
35.29% (-2.94% 🔻)
66.67% (-16.67% 🔻)
66.67% (-4.76% 🔻)

Test suite run failed

Failed tests: 56/753. Failed suites: 8/106.
  ● handlePushStatus() › should throw error if organization not provided

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: "No organization provided, please use --organization option or specify the 'organization' field in the config file.·
    "

    Number of calls: 0

       99 |     );
      100 |
    > 101 |     expect(process.stderr.write).toHaveBeenCalledWith(
          |                                  ^
      102 |       `No organization provided, please use --organization option or specify the 'organization' field in the config file.` +
      103 |         '\n\n'
      104 |     );

      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:101:34
      at fulfilled (packages/cli/src/cms/commands/__tests__/push-status.test.ts:5:58)

  ● handlePushStatus() › should throw error if organization not provided

    expect(received).rejects.toThrowErrorMatchingInlineSnapshot(snapshot)

    Snapshot name: `handlePushStatus() should throw error if organization not provided 1`

    Snapshot: "No organization provided, please use --organization option or specify the 'organization' field in the config file."
    Received: "Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined."

       95 |         mockConfig
       96 |       )
    >  97 |     ).rejects.toThrowErrorMatchingInlineSnapshot(
          |               ^
       98 |       `"No organization provided, please use --organization option or specify the 'organization' field in the config file."`
       99 |     );
      100 |

      at Object.toThrowErrorMatchingInlineSnapshot (node_modules/expect/build/index.js:218:22)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:97:15
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:86:68)

  ● handlePushStatus() › should print success push status for preview-build

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:111:27
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:107:71)

  ● handlePushStatus() › should print success push status for preview and production builds

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:130:27
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:126:87)

  ● handlePushStatus() › should print failed push status for preview build

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: "❌ Preview deploy fail.
    Preview URL: https://preview-test-url·
    "

    Number of calls: 0

      172 |     `);
      173 |
    > 174 |     expect(process.stderr.write).toHaveBeenCalledWith(
          |                                  ^
      175 |       '❌ Preview deploy fail.\nPreview URL: https://preview-test-url' + '\n\n'
      176 |     );
      177 |   });

      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:174:34
      at fulfilled (packages/cli/src/cms/commands/__tests__/push-status.test.ts:5:58)

  ● handlePushStatus() › should print failed push status for preview build

    expect(received).rejects.toThrowErrorMatchingInlineSnapshot(snapshot)

    Snapshot name: `handlePushStatus() should print failed push status for preview build 1`

    - Snapshot  - 2
    + Received  + 1

    - ❌ Preview deploy fail.
    - Preview URL: https://preview-test-url
    + Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      167 |         mockConfig
      168 |       )
    > 169 |     ).rejects.toThrowErrorMatchingInlineSnapshot(`
          |               ^
      170 |       "❌ Preview deploy fail.
      171 |       Preview URL: https://preview-test-url"
      172 |     `);

      at Object.toThrowErrorMatchingInlineSnapshot (node_modules/expect/build/index.js:218:22)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:169:15
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:148:70)

  ● handlePushStatus() › should print success push status for preview build and print scorecards

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:200:27
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:179:92)

  ● handlePushStatus() › should print message if there is no changes

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:235:27
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:220:64)

  ● handlePushStatus() › return value › should return preview deployment info

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:256:44
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:252:60)

  ● handlePushStatus() › return value › should return preview and production deployment info

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:283:44
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:279:75)

  ● handlePushStatus() › "wait" option › should wait for preview "success" deployment status

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:347:44
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:314:74)

  ● handlePushStatus() › "wait" option › should wait for production "success" status after preview "success" status

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:420:44
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:372:97)

  ● handlePushStatus() › "continue-on-deploy-failures" option › should throw error if option value is false

    expect(received).rejects.toThrowErrorMatchingInlineSnapshot(snapshot)

    Snapshot name: `handlePushStatus() "continue-on-deploy-failures" option should throw error if option value is false 1`

    - Snapshot  - 2
    + Received  + 1

    - ❌ Preview deploy fail.
    - Preview URL: https://preview-test-url
    + Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      469 |           mockConfig
      470 |         )
    > 471 |       ).rejects.toThrowErrorMatchingInlineSnapshot(`
          |                 ^
      472 |         "❌ Preview deploy fail.
      473 |         Preview URL: https://preview-test-url"
      474 |       `);

      at Object.toThrowErrorMatchingInlineSnapshot (node_modules/expect/build/index.js:218:22)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:471:17
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:447:66)

  ● handlePushStatus() › "continue-on-deploy-failures" option › should not throw error if option value is true

    expect(received).resolves.toStrictEqual()

    Received promise rejected instead of resolved
    Rejected to value: [TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.]

      488 |       });
      489 |
    > 490 |       await expect(
          |             ^
      491 |         handlePushStatus(
      492 |           {
      493 |             domain: 'test-domain',

      at expect (node_modules/expect/build/index.js:113:15)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:490:13
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:477:69)

  ● handlePushStatus() › "onRetry" callback › should be called when command retries request to API in wait mode for preview deploy

    TypeError: Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      46 |   const spinner = new Spinner();
      47 |
    > 48 |   const { organization, project: projectId, pushId, wait } = argv;
         |           ^
      49 |
      50 |   const orgId = organization || config.organization;
      51 |

      at organization (packages/cli/src/cms/commands/push-status.ts:48:11)
      at packages/cli/src/cms/commands/push-status.ts:3169:39
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push-status.ts:3118:10)
      at handlePushStatus (packages/cli/src/cms/commands/push-status.ts:3211:10)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:548:44
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:513:107)

  ● handlePushStatus() › "max-execution-time" option › should throw error in case "max-execution-time" was exceeded

    expect(received).rejects.toThrowErrorMatchingInlineSnapshot(snapshot)

    Snapshot name: `handlePushStatus() "max-execution-time" option should throw error in case "max-execution-time" was exceeded 1`

    - Snapshot  - 2
    + Received  + 1

    - ✗ Failed to get push status. Reason: Timeout exceeded
    -
    + Cannot destructure property 'organization' of '((cov_s8twd953u(...).s[25]++) , argv)' as it is undefined.

      630 |           mockConfig
      631 |         )
    > 632 |       ).rejects.toThrowErrorMatchingInlineSnapshot(`
          |                 ^
      633 |         "✗ Failed to get push status. Reason: Timeout exceeded
      634 |         "
      635 |       `);

      at Object.toThrowErrorMatchingInlineSnapshot (node_modules/expect/build/index.js:218:22)
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:632:17
      at packages/cli/src/cms/commands/__tests__/push-status.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push-status.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push-status.test.ts:605:83)


  ● push › pushes definition

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:28:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:27:38)

  ● push › fails if jobId value is an empty string

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:58:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:57:60)

  ● push › fails if batchSize value is less than 2

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:75:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:74:60)

  ● push › push with --files

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:98:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:91:38)

  ● push › push should fail if organization not provided

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:122:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:121:66)

  ● push › push should work with organization in config

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:143:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:141:65)

  ● push › push should work if destination not provided but api in config is provided

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:178:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:171:95)

  ● push › push should fail if apis not provided

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:195:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:192:58)

  ● push › push should fail if destination not provided

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:215:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:212:65)

  ● push › push should fail if destination format is not valid

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:236:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:233:72)

  ● push › push should work and encode name with spaces

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push.test.ts:264:21
      at packages/cli/src/__tests__/commands/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:255:65)

  ● transformPush › should adapt the existing syntax

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:284:22)

  ● transformPush › should adapt the existing syntax (including branchName)

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:300:22)

  ● transformPush › should use --branch option firstly

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:317:22)

  ● transformPush › should work for a destination only

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:335:22)

  ● transformPush › should work for a api only

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:350:22)

  ● transformPush › should use destination from option

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:366:22)

  ● transformPush › should use --job-id option firstly

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:384:22)

  ● transformPush › should accept no arguments at all

    TypeError: Cannot destructure property 'apis' of '((cov_2b3wzvcupy(...).s[175]++) , _c)' as it is undefined.

      370 |   (callback: typeof handlePush) =>
      371 |   ({
    > 372 |     argv: { apis, branch, 'batch-id': batchId, 'job-id': jobId, ...rest },
          |             ^
      373 |     config,
      374 |     version,
      375 |   }: CommandArgs<BarePushArgs & { 'batch-id'?: string }>) => {

      at apis (packages/cli/src/commands/push.ts:372:13)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push.test.ts:406:22)


  ● handlePush() › should upload files

    TypeError: Cannot destructure property 'organization' of '((cov_29o50go0lt(...).s[24]++) , argv)' as it is undefined.

      52 |   const startTime = Date.now(); // for push-status command
      53 |
    > 54 |   const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
         |           ^
      55 |
      56 |   const orgId = organization || config.organization;
      57 |

      at organization (packages/cli/src/cms/commands/push.ts:54:11)
      at packages/cli/src/cms/commands/push.ts:2210:40
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push.ts:2159:10)
      at handlePush (packages/cli/src/cms/commands/push.ts:2250:10)
      at packages/cli/src/cms/commands/__tests__/push.test.ts:66:21
      at packages/cli/src/cms/commands/__tests__/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push.test.ts:52:40)

  ● handlePush() › should return push id

    TypeError: Cannot destructure property 'organization' of '((cov_29o50go0lt(...).s[24]++) , argv)' as it is undefined.

      52 |   const startTime = Date.now(); // for push-status command
      53 |
    > 54 |   const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
         |           ^
      55 |
      56 |   const orgId = organization || config.organization;
      57 |

      at organization (packages/cli/src/cms/commands/push.ts:54:11)
      at packages/cli/src/cms/commands/push.ts:2210:40
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push.ts:2159:10)
      at handlePush (packages/cli/src/cms/commands/push.ts:2250:10)
      at packages/cli/src/cms/commands/__tests__/push.test.ts:135:36
      at packages/cli/src/cms/commands/__tests__/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push.test.ts:121:42)

  ● handlePush() › should collect files from directory and preserve file structure

    TypeError: Cannot destructure property 'organization' of '((cov_29o50go0lt(...).s[24]++) , argv)' as it is undefined.

      52 |   const startTime = Date.now(); // for push-status command
      53 |
    > 54 |   const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
         |           ^
      55 |
      56 |   const orgId = organization || config.organization;
      57 |

      at organization (packages/cli/src/cms/commands/push.ts:54:11)
      at packages/cli/src/cms/commands/push.ts:2210:40
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push.ts:2159:10)
      at handlePush (packages/cli/src/cms/commands/push.ts:2250:10)
      at packages/cli/src/cms/commands/__tests__/push.test.ts:191:21
      at packages/cli/src/cms/commands/__tests__/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push.test.ts:159:84)

  ● handlePush() › should not upload files if no files passed

    TypeError: Cannot destructure property 'organization' of '((cov_29o50go0lt(...).s[24]++) , argv)' as it is undefined.

      52 |   const startTime = Date.now(); // for push-status command
      53 |
    > 54 |   const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
         |           ^
      55 |
      56 |   const orgId = organization || config.organization;
      57 |

      at organization (packages/cli/src/cms/commands/push.ts:54:11)
      at packages/cli/src/cms/commands/push.ts:2210:40
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push.ts:2159:10)
      at handlePush (packages/cli/src/cms/commands/push.ts:2250:10)
      at packages/cli/src/cms/commands/__tests__/push.test.ts:233:21
      at packages/cli/src/cms/commands/__tests__/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push.test.ts:229:63)

  ● handlePush() › should get organization from config if not passed

    TypeError: Cannot destructure property 'organization' of '((cov_29o50go0lt(...).s[24]++) , argv)' as it is undefined.

      52 |   const startTime = Date.now(); // for push-status command
      53 |
    > 54 |   const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
         |           ^
      55 |
      56 |   const orgId = organization || config.organization;
      57 |

      at organization (packages/cli/src/cms/commands/push.ts:54:11)
      at packages/cli/src/cms/commands/push.ts:2210:40
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push.ts:2159:10)
      at handlePush (packages/cli/src/cms/commands/push.ts:2250:10)
      at packages/cli/src/cms/commands/__tests__/push.test.ts:268:21
      at packages/cli/src/cms/commands/__tests__/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push.test.ts:254:70)

  ● handlePush() › should get domain from env if not passed

    TypeError: Cannot destructure property 'organization' of '((cov_29o50go0lt(...).s[24]++) , argv)' as it is undefined.

      52 |   const startTime = Date.now(); // for push-status command
      53 |
    > 54 |   const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
         |           ^
      55 |
      56 |   const orgId = organization || config.organization;
      57 |

      at organization (packages/cli/src/cms/commands/push.ts:54:11)
      at packages/cli/src/cms/commands/push.ts:2210:40
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/push.ts:2159:10)
      at handlePush (packages/cli/src/cms/commands/push.ts:2250:10)
      at packages/cli/src/cms/commands/__tests__/push.test.ts:315:21
      at packages/cli/src/cms/commands/__tests__/push.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/cms/commands/__tests__/push.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/cms/commands/__tests__/push.test.ts:300:61)


  ● handleJoin › should call exitWithError because only one entrypoint

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:17:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:16:74)

  ● handleJoin › should call exitWithError because passed all 3 options for tags

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:22:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:21:84)

  ● handleJoin › should call exitWithError because passed all 2 options for tags

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:39:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:38:84)

  ● handleJoin › should call exitWithError because Only OpenAPI 3.0 and OpenAPI 3.1 are supported

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:55:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:54:101)

  ● handleJoin › should call exitWithError if mixing OpenAPI 3.0 and 3.1

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:71:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:67:76)

  ● handleJoin › should call writeToFileByExtension function

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:86:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:84:64)

  ● handleJoin › should call writeToFileByExtension function for OpenAPI 3.1

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:103:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:101:80)

  ● handleJoin › should call writeToFileByExtension function with custom output file

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:120:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:118:88)

  ● handleJoin › should call writeToFileByExtension function with json file extension

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:138:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:136:89)

  ● handleJoin › should call skipDecorators and skipPreprocessors

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:155:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:153:69)

  ● handleJoin › should handle join with prefix-components-with-info-prop and null values

    TypeError: Cannot read properties of undefined (reading 'apis')

      72 |   const startedAt = performance.now();
      73 |
    > 74 |   if (argv.apis.length < 2) {
         |            ^
      75 |     return exitWithError(`At least 2 apis should be provided.`);
      76 |   }
      77 |

      at apis (packages/cli/src/commands/join.ts:74:12)
      at packages/cli/src/commands/join.ts:9696:39
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/join.ts:9645:10)
      at handleJoin (packages/cli/src/commands/join.ts:9751:10)
      at packages/cli/src/__tests__/commands/join.test.ts:171:21
      at packages/cli/src/__tests__/commands/join.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/join.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/join.test.ts:168:93)


  ● #split › should split the file and show the success message

    TypeError: Cannot destructure property 'api' of '((cov_1dusz43mmk(...).s[25]++) , argv)' as it is undefined.

      48 | export async function handleSplit({ argv, collectSpecData }: CommandArgs<SplitOptions>) {
      49 |   const startedAt = performance.now();
    > 50 |   const { api, outDir, separator } = argv;
         |           ^
      51 |   validateDefinitionFileName(api!);
      52 |   const ext = getAndValidateFileExtension(api);
      53 |   const openapi = readYaml(api!) as Oas3Definition | Oas3_1Definition;

      at api (packages/cli/src/commands/split/index.ts:50:11)
      at packages/cli/src/commands/split/index.ts:5768:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/split/index.ts:5717:10)
      at handleSplit (packages/cli/src/commands/split/index.ts:5813:10)
      at packages/cli/src/commands/split/__tests__/index.test.ts:27:22
      at packages/cli/src/commands/split/__tests__/index.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/split/__tests__/index.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/commands/split/__tests__/index.test.ts:23:71)

  ● #split › should use the correct separator

    TypeError: Cannot destructure property 'api' of '((cov_1dusz43mmk(...).s[25]++) , argv)' as it is undefined.

      48 | export async function handleSplit({ argv, collectSpecData }: CommandArgs<SplitOptions>) {
      49 |   const startedAt = performance.now();
    > 50 |   const { api, outDir, separator } = argv;
         |           ^
      51 |   validateDefinitionFileName(api!);
      52 |   const ext = getAndValidateFileExtension(api);
      53 |   const openapi = readYaml(api!) as Oas3Definition | Oas3_1Definition;

      at api (packages/cli/src/commands/split/index.ts:50:11)
      at packages/cli/src/commands/split/index.ts:5768:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/split/index.ts:5717:10)
      at handleSplit (packages/cli/src/commands/split/index.ts:5813:10)
      at packages/cli/src/commands/split/__tests__/index.test.ts:48:22
      at packages/cli/src/commands/split/__tests__/index.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/split/__tests__/index.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/commands/split/__tests__/index.test.ts:43:53)


  ● commandWrapper › should send telemetry if there is "telemetry: on" in the config

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    - Expected
    + Received

      {},
      0,
      false,
    + undefined,
    + undefined,
    + undefined,

    Number of calls: 1

      27 |     expect(handleLint).toHaveBeenCalledTimes(1);
      28 |     expect(sendTelemetry).toHaveBeenCalledTimes(1);
    > 29 |     expect(sendTelemetry).toHaveBeenCalledWith({}, 0, false);
         |                           ^
      30 |   });
      31 |
      32 |   it('should NOT send telemetry if there is "telemetry: off" in the config', async () => {

      at packages/cli/src/__tests__/wrapper.test.ts:29:27
      at fulfilled (packages/cli/src/__tests__/wrapper.test.ts:5:58)


  ● push-with-region › should call login with default domain when region is US

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push-region.test.ts:31:21
      at packages/cli/src/__tests__/commands/push-region.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push-region.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push-region.test.ts:29:76)

  ● push-with-region › should call login with EU domain when region is EU

    TypeError: Cannot read properties of undefined (reading 'region')

      63 |
      64 | export async function handlePush({ argv, config }: CommandArgs<PushOptions>): Promise<void> {
    > 65 |   const client = new RedoclyClient(config.region);
         |                                           ^
      66 |   const isAuthorized = await client.isAuthorizedWithRedoclyByRegion();
      67 |   if (!isAuthorized) {
      68 |     try {

      at region (packages/cli/src/commands/push.ts:65:43)
      at packages/cli/src/commands/push.ts:6089:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/push.ts:6038:10)
      at handlePush (packages/cli/src/commands/push.ts:6244:10)
      at packages/cli/src/__tests__/commands/push-region.test.ts:46:21
      at packages/cli/src/__tests__/commands/push-region.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/push-region.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/push-region.test.ts:44:71)


  ● build-docs › should work correctly when calling handlerBuildCommand

    TypeError: Cannot read properties of undefined (reading 'api')

      17 |   const startedAt = performance.now();
      18 |
    > 19 |   const config = getMergedConfig(configFromFile, argv.api);
         |                                                       ^
      20 |   const apis = await getFallbackApisOrExit(argv.api ? [argv.api] : [], config);
      21 |   const { path: pathToApi } = apis[0];
      22 |

      at api (packages/cli/src/commands/build-docs/index.ts:19:55)
      at packages/cli/src/commands/build-docs/index.ts:1209:40
      at Object.<anonymous>.__awaiter (packages/cli/src/commands/build-docs/index.ts:1158:10)
      at __awaiter (packages/cli/src/commands/build-docs/index.ts:16:34)
      at packages/cli/src/__tests__/commands/build-docs.test.ts:42:30
      at packages/cli/src/__tests__/commands/build-docs.test.ts:8:71
      at Object.<anonymous>.__awaiter (packages/cli/src/__tests__/commands/build-docs.test.ts:4:12)
      at Object.<anonymous> (packages/cli/src/__tests__/commands/build-docs.test.ts:40:75)

Report generated by 🧪jest coverage report action from 5188508

@tatomyr tatomyr self-assigned this Jun 4, 2024
@tatomyr tatomyr force-pushed the chore/aggregate-data-regarding-api-types branch from 9e6a972 to 895cbd2 Compare July 23, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregate data regarding API types/versions usage
1 participant