Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import { describe, expect, it } from 'vitest'; |
| 2 | import { normalizeReleaseTag } from 'src/commands/upgrade/upgrade.handler'; |
| 3 | |
| 4 | describe('upgrade handler: normalizeReleaseTag', () => { |
| 5 | it.each([ |
| 6 | { input: '0.13.1', expected: '@composio/cli@0.13.1' }, |
| 7 | { input: '0.13.1-beta.42', expected: '@composio/cli@0.13.1-beta.42' }, |
| 8 | { input: 'v0.13.1', expected: '@composio/cli@0.13.1' }, |
| 9 | { input: ' 0.13.1 ', expected: '@composio/cli@0.13.1' }, |
| 10 | { input: '@composio/cli@0.13.1', expected: '@composio/cli@0.13.1' }, |
| 11 | { input: ' @composio/cli@0.13.1-beta.42 ', expected: '@composio/cli@0.13.1-beta.42' }, |
| 12 | // Only one leading `v` is dropped; the rest is passed through for the release lookup to reject. |
| 13 | { input: 'vv1', expected: '@composio/cli@v1' }, |
| 14 | ])('[Given] "$input" [Then] returns "$expected"', ({ input, expected }) => { |
| 15 | expect(normalizeReleaseTag(input)).toBe(expected); |
| 16 | }); |
| 17 | }); |