Improve TypeScript tests (#251)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by Sindre Sorhus · parent 27d7b1e · Browse files · 1 file·+32 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+32 added−9 removed
- other:+32 added−9 removed
Provenance
- Commit
0097423- Tree
ba2a417- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
Sindre Sorhus <sindresorhus@gmail.com>- Parent
27d7b1e
1 file changed+32 added−9 removed
modified:index.test-d.ts+32 added-9 removed
13 unmodified lines141516171818192021222324253 unmodified lines29303132333435363738394041424344454647483949505152535455563 unmodified lines60616263646566676869707172737475767726 unmodified lines1041051061078889909192939410810911011111211311411511611711811912012112212312412512612712812923 unmodified lines13 unmodified lines
const unicornsResult = await execaPromise; expectType<string>(unicornsResult.command); expectType<string | number>(unicornsResult.code); expectType<string>(unicornsResult.stderr); expectType<number>(unicornsResult.exitCode); expectType<string>(unicornsResult.exitCodeName); expectType<string>(unicornsResult.stdout); expectType<string>(unicornsResult.stderr); expectType<string>(unicornsResult.all); expectType<boolean>(unicornsResult.failed); expectType<boolean>(unicornsResult.timedOut); expectType<boolean>(unicornsResult.isCanceled);3 unmodified lines const execaError: ExecaError = error;
expectType<string>(execaError.message); expectType<number | string>(execaError.code); expectType<number>(execaError.exitCode); expectType<string>(execaError.exitCodeName); expectType<string>(execaError.stdout); expectType<string>(execaError.stderr); expectType<string>(execaError.all); expectType<boolean>(execaError.failed); expectType<boolean>(execaError.timedOut); expectType<boolean>(execaError.isCanceled); expectType<boolean>(execaError.killed); expectType<string | undefined>(execaError.signal);}
try { const unicornsResult = execa.sync('unicorns'); expectType<string>(unicornsResult.command); expectType<string | number>(unicornsResult.code); expectType<string>(unicornsResult.stderr); expectType<number>(unicornsResult.exitCode); expectType<string>(unicornsResult.exitCodeName); expectType<string>(unicornsResult.stdout); expectType<string>(unicornsResult.stderr); expectError(unicornsResult.all); expectType<boolean>(unicornsResult.failed); expectType<boolean>(unicornsResult.timedOut); expectError(unicornsResult.isCanceled);3 unmodified lines const execaError: ExecaSyncError = error;
expectType<string>(execaError.message); expectType<number | string>(execaError.code); expectType<number>(execaError.exitCode); expectType<string>(execaError.exitCodeName); expectType<string>(execaError.stdout); expectType<string>(execaError.stderr); expectError(execaError.all); expectType<boolean>(execaError.failed); expectType<boolean>(execaError.timedOut); expectError(execaError.isCanceled); expectType<boolean>(execaError.killed); expectType<string | undefined>(execaError.signal);}
execa('unicorns', {cwd: '.'});execa('unicorns', {env: {PATH: ''}});26 unmodified linesexeca('unicorns', {stdin: 'inherit'});execa('unicorns', {stdin: process.stdin});execa('unicorns', {stdin: 1});execa('unicorns', {stdin: undefined});execa('unicorns', {stderr: 'pipe'});execa('unicorns', {stderr: 'ipc'});execa('unicorns', {stderr: 'ignore'});execa('unicorns', {stderr: 'inherit'});execa('unicorns', {stderr: process.stderr});execa('unicorns', {stderr: 1});execa('unicorns', {stderr: undefined});execa('unicorns', {stdout: 'pipe'});execa('unicorns', {stdout: 'ipc'});execa('unicorns', {stdout: 'ignore'});execa('unicorns', {stdout: 'inherit'});execa('unicorns', {stdout: process.stdout});execa('unicorns', {stdout: 1});execa('unicorns', {stdout: undefined});execa('unicorns', {stderr: 'pipe'});execa('unicorns', {stderr: 'ipc'});execa('unicorns', {stderr: 'ignore'});execa('unicorns', {stderr: 'inherit'});execa('unicorns', {stderr: process.stderr});execa('unicorns', {stderr: 1});execa('unicorns', {stderr: undefined});execa('unicorns', {windowsVerbatimArguments: true});execa('unicorns', {input: ''});execa('unicorns', {input: Buffer.from('')});execa('unicorns', {input: process.stdin});
expectType<ExecaChildProcess<string>>(execa('unicorns'));expectType<ExecaReturnValue<string>>(await execa('unicorns'));expectType<ExecaReturnValue<string>>(23 unmodified lines