@@ -6,9 +6,13 @@ import { RooTerminalCallbacks } from "../types"
66import { ExecaTerminal } from "../ExecaTerminal"
77
88describe ( "ExecaTerminal" , ( ) => {
9- it ( "should be a test" , async ( ) => {
10- const terminal = new ExecaTerminal ( 1 , "/tmp" )
9+ it ( "should run terminal commands and collect output" , async ( ) => {
10+ // TODO: Run the equivalent test for Windows.
11+ if ( process . platform === "win32" ) {
12+ return
13+ }
1114
15+ const terminal = new ExecaTerminal ( 1 , "/tmp" )
1216 let result
1317
1418 const callbacks : RooTerminalCallbacks = {
@@ -18,21 +22,14 @@ describe("ExecaTerminal", () => {
1822 onShellExecutionComplete : vi . fn ( ) ,
1923 }
2024
21- const subprocess =
22- process . platform === "win32"
23- ? terminal . runCommand ( "dir" , callbacks )
24- : terminal . runCommand ( "ls -al" , callbacks )
25-
25+ const subprocess = terminal . runCommand ( "ls -al" , callbacks )
2626 await subprocess
2727
2828 expect ( callbacks . onLine ) . toHaveBeenCalled ( )
2929 expect ( callbacks . onShellExecutionStarted ) . toHaveBeenCalled ( )
3030 expect ( callbacks . onShellExecutionComplete ) . toHaveBeenCalled ( )
3131
3232 expect ( result ) . toBeTypeOf ( "string" )
33-
34- if ( process . platform !== "win32" ) {
35- expect ( result ) . toContain ( "total" )
36- }
33+ expect ( result ) . toContain ( "total" )
3734 } )
3835} )
0 commit comments