1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-24 20:06:55 +01:00
unleash.unleash/src/lib/middleware/integration-headers.test.ts
Gastón Fournier abe160eb7d
feat: Unleash v7 ESM migration (#9877)
We're migrating to ESM, which will allow us to import the latest
versions of our dependencies.

Co-Authored-By: Christopher Kolstad <chriswk@getunleash.io>
2025-05-14 09:47:12 +02:00

30 lines
1.3 KiB
TypeScript

import { determineIntegrationSource } from './integration-headers.js';
test('resolves known user agents to source labels', () => {
expect(determineIntegrationSource('axios/0.27.2')).toBe('Axios');
expect(determineIntegrationSource('axios/1.4.0')).toBe('Axios');
expect(determineIntegrationSource('curl/8.6.0')).toBe('Curl');
expect(determineIntegrationSource('node-fetch/1.0.0')).toBe('Node');
expect(determineIntegrationSource('node')).toBe('Node');
expect(determineIntegrationSource('python-requests/2.31.0')).toBe('Python');
expect(determineIntegrationSource('Terraform-Provider-Unleash/1.1.1')).toBe(
'TerraformUnleash',
);
expect(determineIntegrationSource('Jira-Cloud-Unleash')).toBe(
'JiraCloudUnleash',
);
expect(determineIntegrationSource('OpenAPI-Generator/1.0.0/go')).toBe(
'OpenAPIGO',
);
expect(
determineIntegrationSource('Apache-HttpClient/4.5.13 (Java/11.0.22)'),
).toBe('Java');
expect(determineIntegrationSource('Go-http-client/1.1')).toBe('Go');
expect(
determineIntegrationSource(
'rest-client/2.0.2 (linux-gnu x86_64) ruby/2.1.7p400',
),
).toBe('RestClientRuby');
expect(determineIntegrationSource('No-http-client')).toBe('Other');
});