Skip to content
Merged
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
3 changes: 1 addition & 2 deletions packages/cli/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import install from './install/install'; // eslint-disable-line
// @ts-ignore - JS file
import uninstall from './install/uninstall'; // eslint-disable-line
import upgrade from './upgrade/upgrade';
// @ts-ignore - JS file
import info from './info/info'; // eslint-disable-line
import info from './info/info';
// @ts-ignore - JS file
import config from './config/config'; // eslint-disable-line
// @ts-ignore - JS file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow
import info from '../info';
import {logger} from '@react-native-community/cli-tools';
// eslint-disable-next-line import/namespace, import/default
import loadConfig from '../../../tools/config';

jest.mock('../../../tools/config');
Expand All @@ -12,11 +13,11 @@ beforeEach(() => {
const config = loadConfig();

test('prints output without arguments', async () => {
await info.func([], config, {});
await info.func([], config);
expect(logger.info).toHaveBeenCalledWith(
'Fetching system and libraries information...',
);
const output = (logger.log: any).mock.calls[0][0];
const output = (logger.log as jest.Mock).mock.calls[0][0];
// Checking on output that should be present on all OSes.
// TODO: move to e2e tests and adjust expectations to include npm packages
expect(output).toContain('System:');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

// @ts-ignore untyped
import envinfo from 'envinfo';
import {logger} from '@react-native-community/cli-tools';
import type {ConfigT} from 'types';
import {Config} from '@react-native-community/cli-types';
// @ts-ignore - JS file
import releaseChecker from '../../tools/releaseChecker';

const info = async function getInfo(
argv: Array<string>,
ctx: ConfigT,
options: {},
) {
const info = async function getInfo(_argv: Array<string>, ctx: Config) {
try {
logger.info('Fetching system and libraries information...');
const output = await envinfo.run({
Expand Down