Skip to content

Commit

Permalink
refactor(report): require via the shortest path (sverweij#235)
Browse files Browse the repository at this point in the history
was using ../report/yadda instead of ./yadda before,  which is harder to read & maintain
  • Loading branch information
sverweij authored Jan 4, 2020
1 parent dd20f72 commit 15c2bc1
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 14 additions & 14 deletions src/report/index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
const csv = require("../report/csv");
const html = require("../report/html");
const ddot = require("../report/dot/folderLevel");
const dot = require("../report/dot/moduleLevel");
const json = require("../report/json");
const anon = require("./anon");
const csv = require("./csv");
const ddot = require("./dot/folderLevel");
const dot = require("./dot/moduleLevel");
const errHtml = require("./err-html");
const errLong = require("./err/err-long");
const err = require("./err/err-short");
const errHtml = require("./err-html");
const html = require("./html");
const identity = require("./identity");
const json = require("./json");
const teamcity = require("./teamcity");
const anon = require("./anonymous");

const TYPE2REPORTER = {
json,
html,
anon,
csv,
dot,
ddot,
csv,
err,
"err-long": errLong,
"err-html": errHtml,
teamcity,
anon
"err-long": errLong,
err,
html,
json,
teamcity
};

function getReporter(pOutputType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const expect = require("chai").expect;
const _clone = require("lodash/clone");
const anonymize = require("../../../src/report/anonymous");
const anonymizePathElement = require("../../../src/report/anonymous/anonymizePathElement");
const anonymize = require("../../../src/report/anon");
const anonymizePathElement = require("../../../src/report/anon/anonymizePathElement");
const srcReport = require("./mocks/src-report.json");
const srcReportWithWordlist = require("./mocks/src-report-wordlist.json");
const fixtureReport = require("./fixtures/src-report.json");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const expect = require("chai").expect;
const anonymizePath = require("../../../src/report/anonymous/anonymizePath");
const anonymizePathElement = require("../../../src/report/anonymous/anonymizePathElement");
const anonymizePath = require("../../../src/report/anon/anonymizePath");
const anonymizePathElement = require("../../../src/report/anon/anonymizePathElement");

describe("report/anonymous/anonymizePath", () => {
describe("report/anon/anonymizePath", () => {
beforeEach(() => {
anonymizePathElement.clearCache();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const expect = require("chai").expect;
const anonymizePath = require("../../../src/report/anonymous/anonymizePathElement");
const anonymizePath = require("../../../src/report/anon/anonymizePathElement");

describe("report/anonymous/anonymizePathElement - uncached", () => {
describe("report/anon/anonymizePathElement - uncached", () => {
it("'' => ''", () => {
expect(anonymizePath("", [], /^$/, false)).to.equal("");
});
Expand Down Expand Up @@ -37,7 +37,7 @@ describe("report/anonymous/anonymizePathElement - uncached", () => {
});
});

describe("report/anonymous/anonymizePathElement - cached", () => {
describe("report/anon/anonymizePathElement - cached", () => {
it("subsequent calls with the same string yield the same result", () => {
const lFirstResult = anonymizePath("yudelyo");

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const expect = require("chai").expect;
const randomString = require("../../../src/report/anonymous/randomString");
const randomString = require("../../../src/report/anon/randomString");

describe("report/anonymous/randomString", () => {
describe("report/anon/randomString", () => {
it("returns the empty string when passed the empty string", () => {
expect(randomString("")).to.equal("");
});
Expand Down

0 comments on commit 15c2bc1

Please sign in to comment.