mirror of
https://github.com/expo/react-native-community-cli.git
synced 2026-11-15 09:18:35 -10:00
* chore: make `cleanup` async Using `rimraf.sync` can cause `ENOTEMPTY` and `EBUSY` errors on Windows. This can make the Windows CI to fail randomly. Changing to the async method defaults to autoretry 3 times and thus avoiding this issues. * chore: jest config * chore: e2e tests use sync cleanup * chore: pr feedback * chore: revert timeout * Update __e2e__/default.test.ts * Update __e2e__/default.test.ts Co-authored-by: Michał Pierzchała <[email protected]>
29 lines
654 B
TypeScript
29 lines
654 B
TypeScript
import {
|
|
runCLI,
|
|
getTempDirectory,
|
|
cleanupSync,
|
|
writeFiles,
|
|
} from '../jest/helpers';
|
|
|
|
const DIR = getTempDirectory('test_unknown');
|
|
|
|
beforeEach(() => {
|
|
cleanupSync(DIR);
|
|
writeFiles(DIR, {});
|
|
});
|
|
afterEach(() => {
|
|
cleanupSync(DIR);
|
|
});
|
|
|
|
test('warn for passing in unknown commands', () => {
|
|
const {stderr} = runCLI(DIR, ['unknown'], {expectedFailure: true});
|
|
expect(stderr).toContain('error Unrecognized command "unknown".');
|
|
});
|
|
|
|
test('suggest matching command', () => {
|
|
const {stderr} = runCLI(DIR, ['ini'], {expectedFailure: true});
|
|
expect(stderr).toContain(
|
|
'error Unrecognized command "ini". Did you mean "init"?',
|
|
);
|
|
});
|