From e51f208a49b4997de43495d9b3c16e7d6d790c37 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed Date: Mon, 9 Jul 2018 15:42:34 +0200 Subject: [PATCH] Cleanup and remove some jest.fn() --- .../datasource/cloudwatch/specs/datasource.jest.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/app/plugins/datasource/cloudwatch/specs/datasource.jest.ts b/public/app/plugins/datasource/cloudwatch/specs/datasource.jest.ts index b06d00b3ee4..2dc6e57b1aa 100644 --- a/public/app/plugins/datasource/cloudwatch/specs/datasource.jest.ts +++ b/public/app/plugins/datasource/cloudwatch/specs/datasource.jest.ts @@ -1,6 +1,5 @@ import '../datasource'; import CloudWatchDatasource from '../datasource'; -import 'app/features/dashboard/time_srv'; import * as dateMath from 'app/core/utils/datemath'; import _ from 'lodash'; @@ -10,19 +9,20 @@ describe('CloudWatchDatasource', function() { }; let templateSrv = { + data: {}, templateSettings: { interpolate: /\[\[([\s\S]+?)\]\]/g }, - replace: jest.fn(text => _.template(text, templateSrv.templateSettings)(templateSrv.data)), - variableExists: jest.fn(() => false), + replace: text => _.template(text, templateSrv.templateSettings)(templateSrv.data), + variableExists: () => false, }; let timeSrv = { time: { from: 'now-1h', to: 'now' }, - timeRange: jest.fn(() => { + timeRange: () => { return { from: dateMath.parse(timeSrv.time.from, false), to: dateMath.parse(timeSrv.time.to, true), }; - }), + }, }; let backendSrv = {}; let ctx = {