Skip to content

Commit

Permalink
update tests for ttfb
Browse files Browse the repository at this point in the history
  • Loading branch information
ethangardner committed Nov 29, 2024
1 parent 3e78ec0 commit 935c79c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/unit/dap-performance-addon.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { it, describe, expect } from 'vitest';
import { onCLS, onFCP, onINP, onLCP } from '../../src/web-vitals.js';
import { onCLS, onFCP, onINP, onLCP, onTTFB } from '../../src/web-vitals.js';

describe('DAP Performance Addon', () => {
it('defines methods to track Core Web Vitals', () => {
expect(typeof onCLS).toBe('function');
expect(typeof onFCP).toBe('function');
expect(typeof onINP).toBe('function');
expect(typeof onLCP).toBe('function');
expect(typeof onTTFB).toBe('function');
});
});
4 changes: 2 additions & 2 deletions test/unit/format-event-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
FCPAttribution,
INPAttribution,
LCPAttribution,
TTFBAttribution,
} from 'web-vitals';

describe('formatEventData', () => {
Expand Down Expand Up @@ -98,9 +99,8 @@ describe('formatEventData', () => {
dnsDuration: 0,
connectionDuration: 2015,
requestDuration: 47,
};
} as TTFBAttribution;

// @ts-ignore
const result = formatEventData('TTFB', attribution);

expect(result).toEqual({
Expand Down

0 comments on commit 935c79c

Please sign in to comment.