Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve typescript any types and improve error handling #9

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/__tests__/history.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BundleSizeHistory } from '../plugins/history';
import { BundleStats } from '../types/history';
import { mkdir, writeFile, rm } from 'fs/promises';
import { join } from 'path';
import { tmpdir } from 'os';
Expand Down Expand Up @@ -103,14 +102,14 @@

describe('getChunkNames', () => {
it('should return all unique chunk names', async () => {
const chunkNames = await history.getChunkNames();

Check failure on line 105 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (16.x)

Property 'getChunkNames' does not exist on type 'BundleSizeHistory'.

Check failure on line 105 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Property 'getChunkNames' does not exist on type 'BundleSizeHistory'.

Check failure on line 105 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Property 'getChunkNames' does not exist on type 'BundleSizeHistory'.
expect(chunkNames).toEqual([]);
});
});

describe('getDateRange', () => {
it('should return correct date range', async () => {
const range = await history.getDateRange();

Check failure on line 112 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (16.x)

Property 'getDateRange' does not exist on type 'BundleSizeHistory'.

Check failure on line 112 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Property 'getDateRange' does not exist on type 'BundleSizeHistory'.

Check failure on line 112 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Property 'getDateRange' does not exist on type 'BundleSizeHistory'.
expect(range.earliest).toBeNull();
expect(range.latest).toBeNull();
});
Expand All @@ -118,7 +117,7 @@

describe('getSizeRange', () => {
it('should return correct size statistics', async () => {
const stats = await history.getSizeRange();

Check failure on line 120 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (16.x)

Property 'getSizeRange' does not exist on type 'BundleSizeHistory'.

Check failure on line 120 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (18.x)

Property 'getSizeRange' does not exist on type 'BundleSizeHistory'.

Check failure on line 120 in src/__tests__/history.test.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

Property 'getSizeRange' does not exist on type 'BundleSizeHistory'.
expect(stats).toEqual({
min: 0,
max: 0,
Expand Down
Loading
Loading