Skip to content

Commit b01e1db

Browse files
committed
Do not run node tests when node is not available
1 parent 14f3867 commit b01e1db

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(lang dune 2.7)
1+
(lang dune 3.0)
22
(name gen_js_api)
33
(version 1.1.4)
44

dune-workspace.dev

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/test/main.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
(** Some ad hoc code to illustrate and test various aspects
66
of gen_js_api *)
77

8+
[@@@ocaml.warning "-32-34"]
9+
810
open Test_bindings
911

1012
[@@@ocaml.warning "-22"]

gen_js_api.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ license: "MIT"
2020
homepage: "https://github.com/LexiFi/gen_js_api"
2121
bug-reports: "https://github.com/LexiFi/gen_js_api/issues"
2222
depends: [
23-
"dune" {>= "2.7"}
23+
"dune" {>= "3.0"}
2424
"ocaml" {>= "4.08"}
2525
"ppxlib" {>= "0.26"}
2626
"js_of_ocaml-compiler" {with-test}

node-test/test1/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515

1616
(rule
1717
(alias runtest)
18+
(enabled_if %{bin-available:node})
1819
(action
1920
(run node %{dep:./test.bc.js})))

node-test/test1/test.ml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
(* The gen_js_api is released under the terms of an MIT-like license. *)
2+
(* See the attached LICENSE file. *)
3+
(* Copyright 2015 by LexiFi. *)
4+
5+
[@@@ocaml.warning "-32-34"]
6+
17
open Node
28

39
let check_node_version version =
@@ -20,7 +26,7 @@ let check_node_version version =
2026
end
2127

2228
let () =
23-
check_node_version 10
29+
check_node_version 18
2430

2531
(** Buffer **)
2632

@@ -298,4 +304,4 @@ let () =
298304
assert (get (module Ojs.String) a 0 = Some "0");
299305
set (module Ojs.String) a 1 "foo";
300306
assert (get (module Ojs.String) a 1 = Some "foo");
301-
()
307+
()

ojs.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license: "MIT"
1212
homepage: "https://github.com/LexiFi/gen_js_api"
1313
bug-reports: "https://github.com/LexiFi/gen_js_api/issues"
1414
depends: [
15-
"dune" {>= "2.7"}
15+
"dune" {>= "3.0"}
1616
"ocaml" {>= "4.08"}
1717
"js_of_ocaml-compiler" {>= "4.0.0"}
1818
"odoc" {with-doc}

0 commit comments

Comments
 (0)