(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))
 (enabled_if
  (and
   (<> %{profile} wasi)
   (<> %{profile} wasi-with-native-effects)
   (not %{env:CI=false})))
 ; WASI has no notion of tty
 ; isatty_tty does not work on the CI since we are not running in a tty there
 (libraries ocaml_testing unix)
 (modes js wasm))
