Skip to content
Myr

file-url.test-d.ts

This file

Path

test-d/stdio/option/file-url.test-d.ts

44 lines · 1.5 KiB · TypeScript

Last changed by

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

History of this file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 1why, one step back
1import {expectTypeOf, expectError} from 'nz';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 2–35why, one step back
2import {
3 execa,4 execaSync,5 type StdinOption,6 type StdinSyncOption,7 type StdoutStderrOption,8 type StdoutStderrSyncOption,9} from '../../../index.js';1011const fileUrl = new URL('file:///test');1213await execa('unicorns', {stdin: fileUrl});14execaSync('unicorns', {stdin: fileUrl});15await execa('unicorns', {stdin: [fileUrl]});16execaSync('unicorns', {stdin: [fileUrl]});1718await execa('unicorns', {stdout: fileUrl});19execaSync('unicorns', {stdout: fileUrl});20await execa('unicorns', {stdout: [fileUrl]});21execaSync('unicorns', {stdout: [fileUrl]});2223await execa('unicorns', {stderr: fileUrl});24execaSync('unicorns', {stderr: fileUrl});25await execa('unicorns', {stderr: [fileUrl]});26execaSync('unicorns', {stderr: [fileUrl]});2728expectError(await execa('unicorns', {stdio: fileUrl}));29expectError(execaSync('unicorns', {stdio: fileUrl}));3031await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileUrl]});32execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', fileUrl]});33await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileUrl]]});34execaSync('unicorns', {stdio: ['pipe', 'pipe', 'pipe', [fileUrl]]});35

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 36–39why, one step back
36expectTypeOf(fileUrl).toBeAssignableTo<StdinOption>();
37expectTypeOf(fileUrl).toBeAssignableTo<StdinSyncOption>();38[fileUrl] satisfies StdinOption;39[fileUrl] satisfies StdinSyncOption;

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 40why, one step back
40

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 41–44why, one step back
41expectTypeOf(fileUrl).toBeAssignableTo<StdoutStderrOption>();
42expectTypeOf(fileUrl).toBeAssignableTo<StdoutStderrSyncOption>();43[fileUrl] satisfies StdoutStderrOption;44[fileUrl] satisfies StdoutStderrSyncOption;