Files
deepseek-harness/packages/client/ui-plugin-manager/tests/install-analytics.client.spec.ts
T

18 lines
859 B
TypeScript

import { expect, it } from 'vitest'
import { installationAnalyticsInput } from '../src/client/install-analytics.ts'
it.each(['dsh-example', '@scope/plugin', '@scope/[email protected]', 'plugin@latest'])('retains a registry identifier: %s', (spec) => {
expect(installationAnalyticsInput(spec)).toBe(spec)
})
it.each([
['git+https://user:[email protected]/org/repo.git?token=secret#secret', '[git]'],
['https://user:[email protected]/archive.tgz?signature=secret#secret', '[url]'],
['[email protected]:private/repo', '[git]'],
['/Users/private-name/plugin', '[path-or-other]'],
['C:\\Users\\private-name\\plugin', '[path-or-other]'],
['plugin@https://user:[email protected]/archive.tgz', '[path-or-other]'],
])('removes private installer input: %s', (spec, expected) => {
expect(installationAnalyticsInput(spec)).toBe(expected)
})