Commit 49a8c2e0 by Tobias Skarhed

Make beautiful

parent c0f9c06f
...@@ -12,35 +12,35 @@ describe('Prometheus editor completer', function() { ...@@ -12,35 +12,35 @@ describe('Prometheus editor completer', function() {
function getSessionStub(data) { function getSessionStub(data) {
return { return {
getTokenAt:jest.fn(()=> (data.currentToken)), getTokenAt: jest.fn(() => data.currentToken),
getTokens:jest.fn(()=> (data.tokens)), getTokens: jest.fn(() => data.tokens),
getLine:jest.fn(()=> (data.line)), getLine: jest.fn(() => data.line),
}; };
} }
let editor = {}; let editor = {};
let backendSrv = <BackendSrv>{} let backendSrv = <BackendSrv>{};
let datasourceStub = new PrometheusDatasource({},{},backendSrv,{},{}); let datasourceStub = new PrometheusDatasource({}, {}, backendSrv, {}, {});
datasourceStub.performInstantQuery = jest.fn(() => Promise.resolve({ datasourceStub.performInstantQuery = jest.fn(() =>
data: { Promise.resolve({
data: { data: {
result: [ data: {
{ result: [
metric: { {
job: 'node', metric: {
instance: 'localhost:9100', job: 'node',
}, instance: 'localhost:9100',
},
],
}, },
}, },
}) ],
); },
},
})
);
datasourceStub.performSuggestQuery = jest.fn(() => Promise.resolve(['node_cpu'])); datasourceStub.performSuggestQuery = jest.fn(() => Promise.resolve(['node_cpu']));
let templateSrv = { let templateSrv = {
variables: [ variables: [
{ {
......
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