mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
19 lines
457 B
TypeScript
19 lines
457 B
TypeScript
import gfunc from './gfunc';
|
|
|
|
describe('gfunc', () => {
|
|
const INDEX = {
|
|
foo: {
|
|
name: 'foo',
|
|
params: [],
|
|
},
|
|
};
|
|
|
|
it('returns function from the index', () => {
|
|
expect(gfunc.getFuncDef('foo', INDEX)).toEqual(INDEX.foo);
|
|
});
|
|
|
|
it('marks function as unknown when it is not available in the index', () => {
|
|
expect(gfunc.getFuncDef('bar', INDEX)).toEqual({ name: 'bar', params: [{ multiple: true }], unknown: true });
|
|
});
|
|
});
|