Skip to content

Commit

Permalink
Add test for --version output
Browse files Browse the repository at this point in the history
  • Loading branch information
aedart committed Oct 21, 2024
1 parent f786e78 commit f7f5f34
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/cli/packages/cli/version.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@ describe('@aedart/cli', () => {

describe('version', () => {

it('can display version', () => {
it('has version property', () => {
const result = makeCliApplication().version;

assert.strictEqual(typeof result, 'string', 'Cli Application does not have version defined');
});

it('can display version', async () => {
let buffer = '';

const cli = makeCliApplication({
writeOut: (str) => {
buffer = buffer.concat(str).trim();
}
});

// --------------------------------------------------------------- //

await cli.run(['--version'], { from: 'user' });

assert.strictEqual(buffer, cli.version, 'Version was not displayed in output');
});
});
});

0 comments on commit f7f5f34

Please sign in to comment.