1/* eslint-env jest */ 2import fs from 'fs/promises'; 3 4import { execute, projectRoot } from './utils'; 5 6const originalForceColor = process.env.FORCE_COLOR; 7beforeAll(async () => { 8 await fs.mkdir(projectRoot, { recursive: true }); 9 process.env.FORCE_COLOR = '0'; 10}); 11afterAll(() => { 12 process.env.FORCE_COLOR = originalForceColor; 13}); 14 15it('runs `npx expo --version`', async () => { 16 const results = await execute('--version'); 17 expect(results.stdout).toEqual(require('../../package.json').version); 18}); 19it('runs `npx expo -v`', async () => { 20 const results = await execute('-v'); 21 expect(results.stdout).toEqual(require('../../package.json').version); 22}); 23it('asserts with a deprecated command `npx expo send`', async () => { 24 await expect(execute('send')).rejects.toThrow(/expo send is deprecated/); 25}); 26 27it('runs `npx expo --help`', async () => { 28 const results = await execute('--help'); 29 expect(results.stdout).toMatchInlineSnapshot(` 30 " 31 Usage 32 $ npx expo <command> 33 34 Commands 35 start, export, export:web 36 run:ios, run:android, prebuild 37 install, customize, config 38 login, logout, whoami, register 39 40 Options 41 --version, -v Version number 42 --help, -h Usage info 43 44 For more info run a command with the --help flag 45 $ npx expo start --help 46 " 47 `); 48}); 49