diff --git a/tests/cli/packages/cli/version.test.js b/tests/cli/packages/cli/version.test.js index 2dd02a39..22183d6e 100644 --- a/tests/cli/packages/cli/version.test.js +++ b/tests/cli/packages/cli/version.test.js @@ -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'); + }); }); }); \ No newline at end of file