Special case mime type for ts file. (#2902)

This commit is contained in:
Tommaso Sciortino
2025-07-01 16:05:33 -07:00
committed by GitHub
parent 383306e17e
commit 82afc75350
2 changed files with 12 additions and 1 deletions

View File

@@ -196,6 +196,11 @@ describe('fileUtils', () => {
vi.restoreAllMocks(); // Restore spies on actualNodeFs
});
it('should detect typescript type by extension (ts)', () => {
expect(detectFileType('file.ts')).toBe('text');
expect(detectFileType('file.test.ts')).toBe('text');
});
it('should detect image type by extension (png)', () => {
mockMimeLookup.mockReturnValueOnce('image/png');
expect(detectFileType('file.png')).toBe('image');