Commit 42ba0dc7 by Tobias Skarhed

Karma to Jest: Cloudwatch datasource

parent d4bd5213
...@@ -195,6 +195,24 @@ export function TemplateSrvStub() { ...@@ -195,6 +195,24 @@ export function TemplateSrvStub() {
}; };
} }
export function jestTimeSrvStub() {
this.init = jest.fn();
this.time = { from: 'now-1h', to: 'now' };
this.timeRange = jest.fn(parse => {
if (parse === false) {
return this.time;
}
return {
from: dateMath.parse(this.time.from, false),
to: dateMath.parse(this.time.to, true),
};
});
this.replace = jest.fn(target => target);
this.setTime = jest.fn(time => {
this.time = time;
});
}
var allDeps = { var allDeps = {
ContextSrvStub, ContextSrvStub,
TemplateSrvStub, TemplateSrvStub,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment