main-async.js
This file
Path
test/methods/main-async.js
26 lines · 695 bytes · JavaScript
Last changed by
Upgrade xo (#980)ehmickybefore adoptionccfa412
History of this fileTake it
Rename files (#977)ehmickybefore adoption4b2e316
lines 1–3why, one step back1import process from 'node:process';2import test from 'ava';3import {execa} from '../../index.js';Upgrade xo (#980)ehmickybefore adoptionccfa412
line 4why, one step back4import {setFixtureDirectory} from '../helpers/fixtures-directory.js';Rename files (#977)ehmickybefore adoption4b2e316
line 5why, one step back5Upgrade xo (#980)ehmickybefore adoptionccfa412
line 6why, one step back6setFixtureDirectory();Rename files (#977)ehmickybefore adoption4b2e316
lines 7–26why, one step back78const isWindows = process.platform === 'win32';910if (isWindows) {11 test('execa() - cmd file', async t => {12 const {stdout} = await execa('hello.cmd');13 t.is(stdout, 'Hello World');14 });1516 test('execa() - run cmd command', async t => {17 const {stdout} = await execa('cmd', ['/c', 'hello.cmd']);18 t.is(stdout, 'Hello World');19 });20}2122test('execa() returns a promise with pid', async t => {23 const subprocess = execa('noop.js', ['foo']);24 t.is(typeof subprocess.pid, 'number');25 await subprocess;26});