Skip to content

Commit

Permalink
Test types
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Nov 17, 2024
1 parent 8d36744 commit cdb881a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/add-listener.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
describe, it, vi, expect,
describe, it, vi, expect, expectTypeOf,
} from 'vitest';
import {addListener} from './add-listener.js';

Expand All @@ -19,5 +19,12 @@ describe('addListener', () => {

expect(event.removeListener).toHaveBeenCalledWith(listener);
});

it('should have the correct types', () => {
addListener(chrome.tabs.onMoved, (tabId, tab) => {
expectTypeOf(tabId).toEqualTypeOf<number>();
expectTypeOf(tab).toEqualTypeOf<chrome.tabs.TabMoveInfo>();
}, {signal: AbortSignal.timeout(1000)});
});
});

0 comments on commit cdb881a

Please sign in to comment.