Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions refactor #54342

Merged
merged 124 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
84a2ca6
feat: 🎸 add UiComponent interface
streamich Dec 5, 2019
db3c00e
feat: 🎸 add adapter for react => ui components and back
streamich Dec 6, 2019
f61ec5b
refactor: 💡 move registries to shared /common folder
streamich Dec 6, 2019
412d261
feat: 🎸 create expressions service state contaienr
streamich Dec 6, 2019
87be08b
chore: 🤖 export some symbols
streamich Dec 6, 2019
d736d73
feat: 🎸 add Executor class
streamich Dec 6, 2019
459d32e
test: 💍 add simple integration test
streamich Dec 6, 2019
abaa2b6
feat: 🎸 move registries into executor
streamich Jan 10, 2020
39125cb
feat: 🎸 add initial implementation of Execution
streamich Jan 10, 2020
2283a53
feat: 🎸 move Executor's state container into a signle file
streamich Jan 10, 2020
9d7968e
refactor: 💡 move createError() to /common folder
streamich Jan 10, 2020
bbf8042
feat: 🎸 use Executor in plugin definition
streamich Jan 10, 2020
18791c5
refactor: 💡 rename handlers to FunctionHandlers
streamich Jan 13, 2020
33f2df1
feat: 🎸 improve function typings
streamich Jan 21, 2020
b6b500b
feat: 🎸 move types and func in sep folder, improve Execution
streamich Jan 22, 2020
7c80d58
refactor: 💡 cleanup expression_types folder
streamich Jan 22, 2020
90147a0
refactor: 💡 improve typing names of expression types
streamich Jan 22, 2020
193f747
refactor: 💡 remove lodash from ExpressionType and improve types
streamich Jan 22, 2020
c3afeb4
test: 💍 add ExpressionType tests
streamich Jan 22, 2020
c25d125
refactor: 💡 remove function wrappers around types
streamich Jan 22, 2020
acc24c7
refactor: 💡 move functions to /common
streamich Jan 23, 2020
6211ecb
test: 💍 improve expression function tests
streamich Jan 23, 2020
9007458
feat: 🎸 create /parser folder
streamich Jan 23, 2020
d997b00
refactor: 💡 move function types into /expression_functions dir
streamich Jan 23, 2020
5b3f86e
refactor: 💡 improve parser setup
streamich Jan 23, 2020
3a0a17c
refactor: 💡 fix export structure and move args into expr_func
streamich Jan 23, 2020
2cd82bc
test: 💍 add ExpressionFunctionParameter tests
streamich Jan 23, 2020
44e375d
fix: 🐛 fix executor types and imports
streamich Jan 24, 2020
292d4cc
refactor: 💡 move getByAlias to plugin, fix Execution types
streamich Jan 24, 2020
708e5f3
feat: 🎸 add function for argument parsing
streamich Jan 24, 2020
95d44dc
test: 💍 add Executor type tests
streamich Jan 24, 2020
1144b70
test: 💍 add executor function and context tests
streamich Jan 24, 2020
b8fb2fd
test: 💍 check that Executor returns Execution
streamich Jan 24, 2020
cfe84b1
test: 💍 add basic tests for Execution
streamich Jan 24, 2020
3c6b3f7
test: 💍 add basic test for execution of a chain of functions
streamich Jan 24, 2020
3843db2
test: 💍 add "mult" function tot tests
streamich Jan 24, 2020
b4f56da
feat: 🎸 create separate expression_renderer folder
streamich Jan 24, 2020
fdeb631
feat: 🎸 use new executor in public plugin
streamich Jan 24, 2020
ed91bd3
feat: 🎸 remove renderers from executor, add result to execution
streamich Jan 24, 2020
fcd47a3
fix: 🐛 fix Kibana TypeScript errors
streamich Jan 30, 2020
2cf2406
test: 💍 add file to write integration tests for expr plugin
streamich Jan 30, 2020
dd11318
refactor: 💡 move state_containers to /common
streamich Jan 30, 2020
e5cbd50
refactor: 💡 move /parser to /ast and inline format() function
streamich Jan 30, 2020
e1a2b1a
refactor: 💡 remove remaining @kbn/interpreter imports
streamich Jan 30, 2020
28a1033
feat: 🎸 better handling and typing for Executor context
streamich Jan 30, 2020
60789a9
feat: 🎸 use Executor.run function in plugin
streamich Jan 30, 2020
3d60411
fix: 🐛 fix TypeScript type errors
streamich Jan 30, 2020
154fa38
test: 💍 move integration tests into one file
streamich Jan 30, 2020
005aa92
feat: 🎸 create ExpressionsService
streamich Jan 30, 2020
232cb3c
chore: 🤖 clean up legacy code
streamich Jan 30, 2020
d96ca2c
feat: 🎸 use ExpressionsService in /public
streamich Jan 30, 2020
669fd3f
refactor: 💡 move inspector adapters to /common
streamich Jan 30, 2020
538d6a4
feat: 🎸 improve execution
streamich Jan 30, 2020
c191363
feat: 🎸 add state to execution state and don't clone AST
streamich Jan 31, 2020
63ed5ec
test: 💍 add tests for Execution object
streamich Jan 31, 2020
4a3d4b4
test: 💍 improve expression test helpers
streamich Jan 31, 2020
21a3074
test: 💍 add Execution tests
streamich Jan 31, 2020
28c88bb
refactor: 💡 improve required argument checking
streamich Jan 31, 2020
7f8ad62
fix: 🐛 fix Kibana TypeScript errors
streamich Jan 31, 2020
66cadf6
test: 💍 add ExpressionsService unit tests
streamich Jan 31, 2020
12cbc09
fix: 🐛 fix Expression plugin TypeScript types
streamich Jan 31, 2020
47f6619
refactor: 💡 prefix React component with React*
streamich Jan 31, 2020
0fb1062
fix: 🐛 fix X-Pack TypeScript errors
streamich Jan 31, 2020
7492ecb
fix: 🐛 fix test TypeScript errors
streamich Jan 31, 2020
f155df1
fix: 🐛 fix issues preventing loading
streamich Jan 31, 2020
f4808f8
feat: 🎸 remove getInitialContext() handler
streamich Feb 3, 2020
b22aafe
fix: 🐛 fix TypeScript errors
streamich Feb 3, 2020
9146b08
chore: 🤖 remove uicomponent interface
streamich Feb 3, 2020
b80ce80
chore: 🤖 remove missing import
streamich Feb 3, 2020
543375c
fix: 🐛 correctly handle .query in "kibana" expression function
streamich Feb 3, 2020
005ed2c
refactor: 💡 call first arg in expression functions "input"
streamich Feb 3, 2020
beec008
fix: 🐛 do not free Execution state container
streamich Feb 3, 2020
7a35b09
test: 💍 fix tests after refactor
streamich Feb 3, 2020
4f4bc37
test: 💍 fix more tests after refactor
streamich Feb 3, 2020
d7f0130
fix: 🐛 remove redundant export
streamich Feb 4, 2020
a169174
test: 💍 update intepreter_functional test shapshots
streamich Feb 4, 2020
89d0be1
fix: 🐛 relax "kibana" function throwing on missin gsearch ctx
streamich Feb 4, 2020
2c09a07
refactor: 💡 don't use ExpressionAST interface in Canvas
streamich Feb 4, 2020
95eb0e9
docs: ✏️ improve ExpressionRenderer JSDocs
streamich Feb 5, 2020
6fac8e7
refactor: 💡 rename context.types to inputTypes in internal fn
streamich Feb 5, 2020
3547a01
refactor: 💡 replace context.types by unknown in ExprFuncDef
streamich Feb 5, 2020
10e3d28
Merge remote-tracking branch 'upstream/master' into expressions-refactor
streamich Feb 5, 2020
837c672
refactor: 💡 improve expression function definitions in OSS
streamich Feb 5, 2020
47d0906
fix: 🐛 correctly set name on metric_vis_fn
streamich Feb 5, 2020
45fb211
refactor: 💡 improve Lens definitions of expression functions
streamich Feb 5, 2020
5639646
refactor: 💡 improve Canvas expression function definitions
streamich Feb 5, 2020
8270a3e
test: 💍 add createMockExecutionContext() helper
streamich Feb 5, 2020
4611b5e
refactor: 💡 add some type to events$ observable in expr handler
streamich Feb 5, 2020
12aaee4
feat: 🎸 add types to observables in data handler
streamich Feb 5, 2020
306e2e5
Merge remote-tracking branch 'upstream/master' into expressions-refactor
streamich Feb 5, 2020
1e33347
Merge remote-tracking branch 'upstream/master' into expressions-refactor
streamich Feb 5, 2020
760133e
Merge remote-tracking branch 'upstream/master' into expressions-refactor
streamich Feb 5, 2020
f8fb361
refactor: 💡 use inputTypes in canvas
streamich Feb 6, 2020
9b51725
fix: 🐛 fix interpreter grammer generation script
streamich Feb 6, 2020
f7f22e6
feat: 🎸 allow array in getByAlias
streamich Feb 6, 2020
0982bac
test: 💍 simplify test function specs
streamich Feb 6, 2020
beb0243
test: 💍 fix autocomplete tests
streamich Feb 6, 2020
4471e10
fix: 🐛 use correct expression types and NP getFunctions() API
streamich Feb 6, 2020
0495cd5
refactor: 💡 use NP expressions to get renderer
streamich Feb 6, 2020
1a7f230
fix: 🐛 use context.types on server-side Canvas function defs
streamich Feb 6, 2020
fcbe18c
refactor: 💡 use NP API to register Canvas renderers
streamich Feb 6, 2020
255d55b
feat: 🎸 use NP API to get types
streamich Feb 6, 2020
9fa6036
style: 💄 minor formatting changes
streamich Feb 6, 2020
e4c8e29
feat: 🎸 use NP API to get expression functions
streamich Feb 6, 2020
7a15f7a
Merge remote-tracking branch 'upstream/master' into expressions-refactor
streamich Feb 6, 2020
ce361ee
fix: 🐛 fix Canvas workpads
streamich Feb 6, 2020
35b1b9d
test: 💍 add missing mock functions
streamich Feb 6, 2020
62b021e
refactor: 💡 improve Lens func definition argument types
streamich Feb 6, 2020
b7471ae
fix: 🐛 fix Lens type error
streamich Feb 6, 2020
5c744ff
chore: 🤖 catch up with master
streamich Feb 10, 2020
f67af5f
feat: 🎸 make lens datatable work again
streamich Feb 10, 2020
46372cf
feat: 🎸 bootstrap ExpressionsService on server-side
streamich Feb 10, 2020
1c286f5
feat: 🎸 expose more registry related functions in contract
streamich Feb 10, 2020
04d6549
feat: 🎸 add environment: server to server-side expressions
streamich Feb 10, 2020
d621956
docs: ✏️ add documentation
streamich Feb 10, 2020
82c9682
test: 💍 add missing Jest mocks
streamich Feb 10, 2020
4c9beeb
fix: 🐛 correct TypeScript type
streamich Feb 10, 2020
b77393c
chore: 🤖 catch up with master
streamich Feb 10, 2020
8dda340
Merge remote-tracking branch 'upstream/master' into expressions-refactor
streamich Feb 11, 2020
7f45cb9
docs: ✏️ improve documentation
streamich Feb 11, 2020
57e7ba4
fix: 🐛 make FunctionHelpDict type contain only Canvas functions
streamich Feb 11, 2020
568b199
Merge remote-tracking branch 'upstream/master' into expressions-refactor
streamich Feb 11, 2020
8550b8a
fix: 🐛 fix merge conflict
streamich Feb 11, 2020
3d04a47
test: 💍 fix expression mocks
streamich Feb 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/kbn-interpreter/src/common/lib/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export class Registry {
}

register(fn) {
if (typeof fn !== 'function') throw new Error(`Register requires an function`);

const obj = fn();
const obj = typeof fn === 'function' ? fn() : fn;

if (typeof obj !== 'object' || !obj[this._prop]) {
throw new Error(`Registered functions must return an object with a ${this._prop} property`);
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-utility-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ type B = UnwrapPromise<A>; // string
- `ShallowPromise<T>` &mdash; Same as `Promise` type, but it flat maps the wrapped type.
- `UnwrapObservable<T>` &mdash; Returns wrapped type of an observable.
- `UnwrapPromise<T>` &mdash; Returns wrapped type of a promise.
- `UnwrapPromiseOrReturn<T>` &mdash; Returns wrapped type of a promise or the type itself, if it isn't a promise.
5 changes: 5 additions & 0 deletions packages/kbn-utility-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export type ShallowPromise<T> = T extends Promise<infer U> ? Promise<U> : Promis
*/
export type UnwrapPromise<T extends Promise<any>> = PromiseType<T>;

/**
* Returns wrapped type of a promise, or returns type as is, if it is not a promise.
*/
export type UnwrapPromiseOrReturn<T> = T extends Promise<infer U> ? U : T;

/**
* Minimal interface for an object resembling an `Observable`.
*/
Expand Down
23 changes: 10 additions & 13 deletions src/legacy/core_plugins/data/public/search/expressions/esaggs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { createFormat } from 'ui/visualize/loader/pipeline_helpers/utilities';
import {
KibanaContext,
KibanaDatatable,
ExpressionFunction,
ExpressionFunctionDefinition,
KibanaDatatableColumn,
} from 'src/plugins/expressions/public';
import {
Expand Down Expand Up @@ -66,7 +66,8 @@ export interface RequestHandlerParams {

const name = 'esaggs';

type Context = KibanaContext | null;
type Input = KibanaContext | null;
type Output = Promise<KibanaDatatable>;

interface Arguments {
index: string;
Expand All @@ -76,8 +77,6 @@ interface Arguments {
aggConfigs: string;
}

type Return = Promise<KibanaDatatable>;

const handleCourierRequest = async ({
searchSource,
aggs,
Expand Down Expand Up @@ -221,12 +220,10 @@ const handleCourierRequest = async ({
return (searchSource as any).tabifiedResponse;
};

export const esaggs = (): ExpressionFunction<typeof name, Context, Arguments, Return> => ({
export const esaggs = (): ExpressionFunctionDefinition<typeof name, Input, Arguments, Output> => ({
name,
type: 'kibana_datatable',
context: {
types: ['kibana_context', 'null'],
},
inputTypes: ['kibana_context', 'null'],
help: i18n.translate('data.functions.esaggs.help', {
defaultMessage: 'Run AggConfig aggregation',
}),
Expand Down Expand Up @@ -256,7 +253,7 @@ export const esaggs = (): ExpressionFunction<typeof name, Context, Arguments, Re
help: '',
},
},
async fn(context, args, { inspectorAdapters, abortSignal }) {
async fn(input, args, { inspectorAdapters, abortSignal }) {
const indexPatterns = getIndexPatterns();
const { filterManager } = getQueryService();

Expand All @@ -272,13 +269,13 @@ export const esaggs = (): ExpressionFunction<typeof name, Context, Arguments, Re
const response = await handleCourierRequest({
searchSource,
aggs,
timeRange: get(context, 'timeRange', undefined),
query: get(context, 'query', undefined),
filters: get(context, 'filters', undefined),
timeRange: get(input, 'timeRange', undefined),
query: get(input, 'query', undefined),
filters: get(input, 'filters', undefined),
forceFetch: true,
metricsAtAllLevels: args.metricsAtAllLevels,
partialRows: args.partialRows,
inspectorAdapters,
inspectorAdapters: inspectorAdapters as Adapters,
filterManager,
abortSignal: (abortSignal as unknown) as AbortSignal,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
import { createInputControlVisFn } from './input_control_fn';

// eslint-disable-next-line
import { functionWrapper } from '../../../../plugins/expressions/public/functions/tests/utils';
import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';

jest.mock('./legacy_imports.ts');

describe('interpreter/functions#input_control_vis', () => {
const fn = functionWrapper(createInputControlVisFn);
const fn = functionWrapper(createInputControlVisFn());
const visConfig = {
controls: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@
import { i18n } from '@kbn/i18n';

import {
ExpressionFunction,
ExpressionFunctionDefinition,
KibanaDatatable,
Render,
} from '../../../../plugins/expressions/public';

const name = 'input_control_vis';

type Context = KibanaDatatable;

interface Arguments {
visConfig: string;
}
Expand All @@ -40,19 +36,15 @@ interface RenderValue {
visConfig: VisParams;
}

type Return = Promise<Render<RenderValue>>;

export const createInputControlVisFn = (): ExpressionFunction<
typeof name,
Context,
export const createInputControlVisFn = (): ExpressionFunctionDefinition<
'input_control_vis',
KibanaDatatable,
Arguments,
Return
Render<RenderValue>
> => ({
name: 'input_control_vis',
type: 'render',
context: {
types: [],
},
inputTypes: [],
help: i18n.translate('inputControl.function.help', {
defaultMessage: 'Input control visualization',
}),
Expand All @@ -63,7 +55,7 @@ export const createInputControlVisFn = (): ExpressionFunction<
help: '',
},
},
async fn(context, args) {
fn(input, args) {
const params = JSON.parse(args.visConfig);
return {
type: 'render',
Expand Down
20 changes: 0 additions & 20 deletions src/legacy/core_plugins/interpreter/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
Interpreter legacy plugin has been migrated to the New Platform. Use
`expressions` New Platform plugin instead.

In the New Platform:

```ts
class MyPlugin {
setup(core, { expressions }) {
expressions.registerFunction(myFunction);
}
start(core, { expressions }) {
}
}
```

In the Legacy Platform:

```ts
import { npSetup, npStart } from 'ui/new_platform';

npSetup.plugins.expressions.registerFunction(myFunction);
```
7 changes: 2 additions & 5 deletions src/legacy/core_plugins/interpreter/public/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ import 'uiExports/interpreter';
import { register, registryFactory } from '@kbn/interpreter/common';
import { npSetup } from 'ui/new_platform';
import { registries } from './registries';
import {
ExpressionInterpretWithHandlers,
ExpressionExecutor,
} from '../../../../plugins/expressions/public';
import { Executor, ExpressionExecutor } from '../../../../plugins/expressions/public';

// Expose kbnInterpreter.register(specs) and kbnInterpreter.registries() globally so that plugins
// can register without a transpile step.
Expand All @@ -46,7 +43,7 @@ export const getInterpreter = async () => {
};

// TODO: This function will be left behind in the legacy platform.
export const interpretAst: ExpressionInterpretWithHandlers = async (ast, context, handlers) => {
export const interpretAst: Executor['run'] = async (ast, context, handlers) => {
const { interpreter } = await getInterpreter();
return await interpreter.interpretAst(ast, context, handlers);
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
*/

// eslint-disable-next-line
import { functionWrapper } from '../../../../plugins/expressions/public/functions/tests/utils';
import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';
import { createRegionMapFn } from './region_map_fn';

jest.mock('ui/new_platform');

describe('interpreter/functions#regionmap', () => {
const fn = functionWrapper(createRegionMapFn);
const fn = functionWrapper(createRegionMapFn());
const context = {
type: 'kibana_datatable',
rows: [{ 'col-0-1': 0 }],
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/core_plugins/tile_map/public/tilemap_fn.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

// eslint-disable-next-line
import { functionWrapper } from '../../../../plugins/expressions/public/functions/tests/utils';
import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';
import { createTileMapFn } from './tile_map_fn';

jest.mock('ui/new_platform');
Expand All @@ -40,7 +40,7 @@ jest.mock('ui/vis/map/convert_to_geojson', () => ({
import { convertToGeoJson } from 'ui/vis/map/convert_to_geojson';

describe('interpreter/functions#tilemap', () => {
const fn = functionWrapper(createTileMapFn);
const fn = functionWrapper(createTileMapFn());
const context = {
type: 'kibana_datatable',
rows: [{ 'col-0-1': 0 }],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/

// eslint-disable-next-line
import { functionWrapper } from '../../../../plugins/expressions/public/functions/tests/utils';
import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';
import { createMarkdownVisFn } from './markdown_fn';

describe('interpreter/functions#markdown', () => {
const fn = functionWrapper(createMarkdownVisFn);
const fn = functionWrapper(createMarkdownVisFn());
const args = {
font: { spec: { fontSize: 12 } },
openLinksInNewTab: true,
Expand Down
24 changes: 8 additions & 16 deletions src/legacy/core_plugins/vis_type_markdown/public/markdown_fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,23 @@
*/

import { i18n } from '@kbn/i18n';
import { ExpressionFunction, Render } from '../../../../plugins/expressions/public';
import { ExpressionFunctionDefinition, Render } from '../../../../plugins/expressions/public';
import { Arguments, MarkdownVisParams } from './types';

const name = 'markdownVis';

type Context = undefined;

interface RenderValue {
visType: 'markdown';
visConfig: MarkdownVisParams;
}

type Return = Promise<Render<RenderValue>>;

export const createMarkdownVisFn = (): ExpressionFunction<
typeof name,
Context,
export const createMarkdownVisFn = (): ExpressionFunctionDefinition<
'markdownVis',
unknown,
Arguments,
Return
Render<RenderValue>
> => ({
name,
name: 'markdownVis',
type: 'render',
context: {
types: [],
},
inputTypes: [],
help: i18n.translate('visTypeMarkdown.function.help', {
defaultMessage: 'Markdown visualization',
}),
Expand Down Expand Up @@ -70,7 +62,7 @@ export const createMarkdownVisFn = (): ExpressionFunction<
}),
},
},
async fn(context, args) {
fn(input, args) {
return {
type: 'render',
as: 'visualization',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,19 @@

import { last, findIndex, isNaN } from 'lodash';
import React, { Component } from 'react';

import { isColorDark } from '@elastic/eui';

import { getFormat } from '../legacy_imports';
import { MetricVisValue } from './metric_vis_value';
import { fieldFormats } from '../../../../../plugins/data/public';
import { Context } from '../metric_vis_fn';
import { Input } from '../metric_vis_fn';
import { KibanaDatatable } from '../../../../../plugins/expressions/public';
import { getHeatmapColors } from '../../../../../plugins/charts/public';
import { VisParams, MetricVisMetric } from '../types';
import { SchemaConfig, Vis } from '../../../visualizations/public';

export interface MetricVisComponentProps {
visParams: VisParams;
visData: Context;
visData: Input;
vis: Vis;
renderComplete: () => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

import { createMetricVisFn } from './metric_vis_fn';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { functionWrapper } from '../../../../plugins/expressions/public/functions/tests/utils';
import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';

jest.mock('ui/new_platform');

describe('interpreter/functions#metric', () => {
const fn = functionWrapper(createMetricVisFn);
const fn = functionWrapper(createMetricVisFn());
const context = {
type: 'kibana_datatable',
rows: [{ 'col-0-1': 0 }],
Expand Down
Loading