(tests
 (names isatty_std)
 (libraries ocaml_testing unix)
 (modes js wasm))

(tests
 (names isatty_tty)
 ; In_channel.isatty / Out_channel.isatty are OCaml 5.1+. Gate the build
 ; (not just the run) with build_if: enabled_if only skips running the
 ; test, so on older compilers it would still be compiled by @all and
 ; fail with "Unbound value In_channel.isatty".
 (build_if
  (>= %{ocaml_version} 5.1))
 ; WASI has no notion of tty. The test falls back to a fresh pty master
 ; from /dev/ptmx when there is no controlling terminal, so it does not
 ; need a tty attached; on Windows it opens the console through CONIN$.
 (enabled_if
  (<> %{env:JSOO_TEST_ENGINE=node} wasi))
 (libraries ocaml_testing unix)
 (modes js wasm))
