Skip to content

Commit

Permalink
Merge pull request #238 from jaredwray/removing-log-output-on-certain…
Browse files Browse the repository at this point in the history
…-tests

removing log output on certain tests
  • Loading branch information
jaredwray authored Jan 11, 2024
2 parents a8d0991 + d63a969 commit fe286f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/writr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default class Writr {
}

default: {
console.log(this.options);
const builder = new WritrBuilder(this.options);
await builder.build();
break;
Expand Down
10 changes: 10 additions & 0 deletions test/writr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,17 @@ describe('writr execute', () => {
buildOptions.outputPath = 'test/fixtures/single-page-site/dist';
buildOptions.templatePath = 'test/fixtures/template-example/';
const writr = new Writr(buildOptions);
const consoleLog = console.log;
// eslint-disable-next-line @typescript-eslint/no-empty-function
console.log = message => {};

process.argv = ['node', 'writr'];
await writr.execute(process);

expect(fs.existsSync(buildOptions.outputPath)).toEqual(true);

fs.rmdirSync(buildOptions.outputPath, {recursive: true});
console.log = consoleLog;
});
it('should be able to execute with output parameter', async () => {
const buildOptions = new WritrOptions();
Expand All @@ -161,12 +166,17 @@ describe('writr execute', () => {
buildOptions.templatePath = 'test/fixtures/template-example/';
const realOutputPath = 'test/fixtures/single-page-site/dist1';
const writr = new Writr(buildOptions);
const consoleLog = console.log;
// eslint-disable-next-line @typescript-eslint/no-empty-function
console.log = message => {};

process.argv = ['node', 'writr', '-o', realOutputPath];
await writr.execute(process);

expect(fs.existsSync(realOutputPath)).toEqual(true);

fs.rmdirSync(realOutputPath, {recursive: true});
console.log = consoleLog;
});
it('should init based on the init command', async () => {
const writr = new Writr(defaultOptions);
Expand Down

0 comments on commit fe286f7

Please sign in to comment.