Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion actions/info.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class InfoAction extends AbstractAction {
console.info(green`[System Information]`);
console.info(
'OS Version :',
blue(osName(platform(), release()) + release()),
blue(osName(platform(), release()) + ' ' + release()),
);
console.info('NodeJS Version :', blue(process.version));
await this.displayPackageManagerVersion();
Expand Down
22 changes: 22 additions & 0 deletions test/actions/info.action.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ describe('InfoAction', () => {
infoAction = new InfoAction();
});

describe('displaySystemInformation', () => {
it('should include a space between the OS name and release version', async () => {
const consoleSpy = jest
.spyOn(console, 'info')
.mockImplementation(() => {});

await infoAction.handle();

const osVersionCall = consoleSpy.mock.calls.find(
(call) =>
typeof call[0] === 'string' && call[0].includes('OS Version'),
);
expect(osVersionCall).toBeDefined();
// The second argument (blue-colored string) should have a space
// between the OS name and the kernel release
const osVersionValue: string = osVersionCall![1];
expect(osVersionValue).toMatch(/\w\s+\d/);

consoleSpy.mockRestore();
});
});

describe('buildNestVersionsWarningMessage', () => {
it('should return an empty object for one or zero minor versions', () => {
const dependencies = [
Expand Down