Handle the invalid command resulting in infinite loop
Changes
-
Check if the command provided to sync-db in valid one
-
Show the available command in case of invalid entry
-
Fixes the infinite loop while unknown command is given to sync-db
Test
Before
DEBUG=* yarn sync-db gg
After
DEBUG=* yarn sync-db gg
Resolves https://github.com/leapfrogtechnology/sync-db/issues/242
Codecov Report
Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
Project coverage is 35.13%. Comparing base (
8322436) to head (c9a1cfb).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/commands/index.ts | 0.00% | 5 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #243 +/- ##
==========================================
- Coverage 35.34% 35.13% -0.21%
==========================================
Files 33 34 +1
Lines 863 868 +5
Branches 115 116 +1
==========================================
Hits 305 305
- Misses 549 554 +5
Partials 9 9
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Will add the tests
@samirsilwal Surprised that ocli doesn't have this by default?