Skip to content

Commit

Permalink
add version test
Browse files Browse the repository at this point in the history
  • Loading branch information
staff0rd committed Nov 18, 2021
1 parent 8c26006 commit c90a575
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/version.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { cli } from '../src';
import * as utils from '../src/utils/configUtils';

describe('version', () => {
it('should print version', async () => {
jest.spyOn(utils, 'parseJson').mockResolvedValue({ version: '1.2.3' });
const spy = jest.spyOn(console, 'info');

await cli.execute([
'',
'',
'--version'
]);

expect(spy).toHaveBeenCalledWith('httpyac v1.2.3');
});
});

0 comments on commit c90a575

Please # to comment.