Skip to content

Commit

Permalink
[#134] Fix tests and adjust send event
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanluker committed Jul 1, 2018
1 parent fc62dad commit 7fbcea9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 30 deletions.
4 changes: 0 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ import {Reporter} from "./reporter";
import {StatusBarToggler} from "./statusbartoggler";
import {Fs} from "./wrappers/fs";
import {Glob} from "./wrappers/glob";
import {LcovParse} from "./wrappers/lcov-parse";
import {Request} from "./wrappers/request";
import {Vscode} from "./wrappers/vscode";
import {XmlParse} from "./wrappers/xml-parse";

const fsImpl = new Fs();
const xmlParseImpl = new XmlParse();
const lcovParseImpl = new LcovParse();
const vscodeImpl = new Vscode();
const globImpl = new Glob();

Expand Down
4 changes: 2 additions & 2 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export class Renderer {
const message = template + `${filePath} [exactness score]: ${topSection.score}`;
this.outputChannel.appendLine(message);
// log event and file type
this.eventReporter.sendEvent("system", "renderer", "correctness", topSection.score);
this.eventReporter.sendEvent("system", "renderer", "fileType", extname(filePath));
this.eventReporter.sendEvent("system", "renderer-correctness", topSection.score.toString());
this.eventReporter.sendEvent("system", "renderer-fileType", extname(filePath));
}

return topSection.section;
Expand Down
2 changes: 1 addition & 1 deletion src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Reporter {
category: string,
action: string,
label?: string,
value?: number | string,
value?: number,
) {
if (!this.enableMetrics) { return; }
const data = {
Expand Down
11 changes: 0 additions & 11 deletions src/wrappers/lcov-parse.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/wrappers/xml-parse.ts

This file was deleted.

6 changes: 5 additions & 1 deletion test/renderer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ suite("Renderer Tests", function() {
show: () => {},
};

const fakeReporter = {
sendEvent: () => {},
}

test("Constructor should setup properly @unit", function(done) {
assert.doesNotThrow(() => new Renderer(fakeConfig, fakeOutput));
assert.doesNotThrow(() => new Renderer(fakeConfig, fakeOutput, fakeReporter as any));
return done();
});
});

0 comments on commit 7fbcea9

Please sign in to comment.