Skip to content

Commit

Permalink
split vercel and generic config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schehata committed Sep 20, 2022
1 parent 023839b commit e6c1c15
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
15 changes: 15 additions & 0 deletions __tests__/genericConfig.vercel.ts
@@ -0,0 +1,15 @@
process.env.AXIOM_INGEST_ENDPOINT = '';
process.env.AXIOM_URL = 'https://test.axiom.co';
process.env.AXIOM_DATASET = 'test';

import { config, EndpointType } from '../src/shared';

test('reading axiom ingest endpoint', () => {

let url = config.getIngestURL(EndpointType.webVitals);
expect(url).toEqual('https://test.axiom.co/api/v1/datasets/test/ingest');

url = config.getIngestURL(EndpointType.logs);
expect(url).toEqual('https://test.axiom.co/api/v1/datasets/test/ingest');
});

22 changes: 0 additions & 22 deletions __tests__/shared.test.ts

This file was deleted.

12 changes: 12 additions & 0 deletions __tests__/vercelConfig.test.ts
@@ -0,0 +1,12 @@
process.env.AXIOM_URL = '';
process.env.AXIOM_INGEST_ENDPOINT = 'https://axiom.co/api/v1/integrations/vercel';

import { config, EndpointType } from '../src/shared';

test('reading vercel ingest endpoint', () => {
let url = config.getIngestURL(EndpointType.webVitals);
expect(url).toEqual('https://axiom.co/api/v1/integrations/vercel?type=web-vitals');

url = config.getIngestURL(EndpointType.logs);
expect(url).toEqual('https://axiom.co/api/v1/integrations/vercel?type=logs');
});

0 comments on commit e6c1c15

Please sign in to comment.