๐Ÿ“ฆ Kong / httpsnippet

๐Ÿ“„ utils.test.ts ยท 20 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20import { availableTargets, extname } from './utils';

describe('availableTargets', () => {
  it('returns all available targets', () => {
    expect(availableTargets()).toMatchSnapshot();
  });
});

describe('extname', () => {
  it('returns the correct extension', () => {
    expect(extname('c')).toBe('.c');
    expect(extname('clojure')).toBe('.clj');
  });

  it('returns empty string if the extension is not found', () => {
    // @ts-expect-error intentionally incorrect
    expect(extname('ziltoid')).toBe('');
  });
});