gfunc.test.ts 527 B

1234567891011121314151617181920212223
  1. import gfunc from './gfunc';
  2. describe('gfunc', () => {
  3. const INDEX = {
  4. foo: {
  5. name: 'foo',
  6. params: [],
  7. },
  8. };
  9. it('returns function from the index', () => {
  10. expect(gfunc.getFuncDef('foo', INDEX)).toEqual(INDEX.foo);
  11. });
  12. it('marks function as unknown when it is not available in the index', () => {
  13. expect(gfunc.getFuncDef('bar', INDEX)).toEqual({
  14. name: 'bar',
  15. params: [{ name: '', type: '', multiple: true }],
  16. defaultParams: [''],
  17. unknown: true,
  18. });
  19. });
  20. });