Skip to content

Commit 947b4c0

Browse files
committed
chore(cli): adds output for report
1 parent db9e6b7 commit 947b4c0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cli/src/find-smells.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const args = process.argv;
88
const fileName = args[2];
99
const language = args[3] as SupportedLanguages || SupportedLanguages.javascript;
1010
const report = args[4];
11+
const reportOutput = args[5];
1112

1213
if (!fileName) {
1314
console.error('[SMELLY] please provide a test file');
@@ -45,7 +46,7 @@ async function execute() {
4546
aggregator.push({ fileName: file, smells, language });
4647
}
4748

48-
const to = path.resolve(`${__dirname}/../..`);
49+
const to = path.resolve(reportOutput);
4950
const report = new SmellsAggreagtor(aggregator, { to });
5051
report.build();
5152

cli/test/cli.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const execPromise = promisify(exec);
77
describe('cli', () => {
88

99
it('find no smells for a given path', async () => {
10-
const { stdout } = await execPromise(`npm run cli -- fake-data/no-smells/ javascript --report=html`);
10+
const { stdout } = await execPromise(`npm run cli -- fake-data/no-smells/ javascript --report=html --report-output=$(pwd)`);
1111

1212
assert.equal(true, stdout.includes("Report HTML generated"));
1313
});

0 commit comments

Comments
 (0)