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

fix cli test failure #901

Merged
merged 1 commit into from
Nov 8, 2023
Merged

fix cli test failure #901

merged 1 commit into from
Nov 8, 2023

Conversation

nick-bisonai
Copy link
Collaborator

@nick-bisonai nick-bisonai commented Nov 8, 2023

Description

fetcherType has been defined as optional parameter from cli

const insert = command({
    name: 'insert',
    args: {
      data: option({
        type: ReadFile,
        long: 'source'
      }),
      chain: option({
        type: cmdstring,
        long: 'chain'
      }),
      fetcherType: fetcherTypeOptionalOption
    },
    handler: insertHandler()
  })

yet the wrapped function which was called inside wasn't setting the parameter as optional. so the error has occured

nick@NICKui-MacBookPro ~/development/orakl/cli   master ✭ 1 ?1              ✔
❯❯❯ yarn test
yarn run v1.22.19
$ node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js
 FAIL  test/aggregator.ts
  ● Test suite failed to run

    test/aggregator.ts:22:27 - error TS2345: Argument of type '{ data: { active: boolean; name: string; address: string; fixedHeartbeatRate: number; threshold: number; absoluteThreshold: number; adapterId: string; }; chain: string; }' is not assignable to parameter of type '{ data: any; chain: string; fetcherType: number; }'.
      Property 'fetcherType' is missing in type '{ data: { active: boolean; name: string; address: string; fixedHeartbeatRate: number; threshold: number; absoluteThreshold: number; adapterId: string; }; chain: string; }' but required in type '{ data: any; chain: string; fetcherType: number; }'.

    22     await insertHandler()({ data: AGGREGATOR, chain: 'localhost' })
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      src/aggregator.ts:188:5
        188     fetcherType: number
                ~~~~~~~~~~~
        'fetcherType' is declared here.
    test/aggregator.ts:28:27 - error TS2345: Argument of type '{ data: { active: boolean; name: string; address: string; fixedHeartbeatRate: number; threshold: number; absoluteThreshold: number; adapterId: string; }; chain: string; }' is not assignable to parameter of type '{ data: any; chain: string; fetcherType: number; }'.
      Property 'fetcherType' is missing in type '{ data: { active: boolean; name: string; address: string; fixedHeartbeatRate: number; threshold: number; absoluteThreshold: number; adapterId: string; }; chain: string; }' but required in type '{ data: any; chain: string; fetcherType: number; }'.

    28     await insertHandler()({ data: AGGREGATOR, chain: 'localhost' })
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      src/aggregator.ts:188:5
        188     fetcherType: number
                ~~~~~~~~~~~
        'fetcherType' is declared here.
    test/aggregator.ts:30:29 - error TS2345: Argument of type '{ data: { active: boolean; name: string; address: string; fixedHeartbeatRate: number; threshold: number; absoluteThreshold: number; adapterId: string; }; chain: string; }' is not assignable to parameter of type '{ data: any; chain: string; fetcherType: number; }'.
      Property 'fetcherType' is missing in type '{ data: { active: boolean; name: string; address: string; fixedHeartbeatRate: number; threshold: number; absoluteThreshold: number; adapterId: string; }; chain: string; }' but required in type '{ data: any; chain: string; fetcherType: number; }'.

    30       await insertHandler()({ data: AGGREGATOR, chain: 'localhost' })
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      src/aggregator.ts:188:5
        188     fetcherType: number
                ~~~~~~~~~~~
        'fetcherType' is declared here.

Test Suites: 1 failed, 7 skipped, 1 of 8 total
Tests:       23 skipped, 23 total
Snapshots:   0 total
Time:        1.59 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

it's been fixed

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Deployment

  • Should publish npm package
  • Should publish Docker image

@nick-bisonai nick-bisonai self-assigned this Nov 8, 2023
@nick-bisonai nick-bisonai requested a review from a team as a code owner November 8, 2023 05:03
@nick-bisonai nick-bisonai linked an issue Nov 8, 2023 that may be closed by this pull request
Copy link
Member

@martinkersner martinkersner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nick-bisonai nick-bisonai merged commit f6a2464 into master Nov 8, 2023
1 check passed
@nick-bisonai nick-bisonai deleted the i-897/fix/test-failure-fix branch November 8, 2023 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli test fail
2 participants