File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -48,4 +48,6 @@ let () =
48
48
49
49
50
50
let () =
51
+ (* Js.log ("ARGV", Bs_node.Process.process##argv); *)
51
52
Mt. from_pair_suites __FILE__ ! suites
53
+
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
var Caml_builtin_exceptions = require ( "../../lib/js/caml_builtin_exceptions" ) ;
4
- var Process = require ( "process" ) ;
5
4
var Assert = require ( "assert" ) ;
6
5
var Curry = require ( "../../lib/js/curry" ) ;
7
- var Path = require ( "path" ) ;
8
6
var $$Array = require ( "../../lib/js/array" ) ;
7
+ var Path = require ( "path" ) ;
9
8
var List = require ( "../../lib/js/list" ) ;
9
+ var Process = require ( "process" ) ;
10
10
11
11
function is_mocha ( ) {
12
12
var match = $$Array . to_list ( Process . argv ) ;
13
13
if ( match ) {
14
- var exec = Path . basename ( match [ 0 ] ) ;
15
- if ( exec === "mocha" ) {
16
- return /* true */ 1 ;
14
+ var match$1 = match [ 1 ] ;
15
+ if ( match$1 ) {
16
+ var exec = Path . basename ( match$1 [ 0 ] ) ;
17
+ if ( exec === "mocha" ) {
18
+ return /* true */ 1 ;
19
+ }
20
+ else {
21
+ return + ( exec === "_mocha" ) ;
22
+ }
17
23
}
18
24
else {
19
- return + ( exec === "_mocha" ) ;
25
+ return /* false */ 0 ;
20
26
}
21
27
}
22
28
else {
@@ -92,4 +98,4 @@ function from_pair_suites(name, suites) {
92
98
93
99
exports . from_suites = from_suites ;
94
100
exports . from_pair_suites = from_pair_suites ;
95
- /* process Not a pure module */
101
+ /* assert Not a pure module */
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ let assert_notequal = neq
28
28
29
29
let is_mocha () =
30
30
match Array. to_list Bs_node.Process. process##argv with
31
- | cmd :: _ ->
32
- let exec = Bs_node.Path. basename cmd in
31
+ | _node :: mocha :: _ ->
32
+ let exec = Bs_node.Path. basename mocha in
33
33
exec = " mocha" || exec = " _mocha"
34
34
| _ -> false
35
35
(* assert -- raises an AssertionError which mocha handls better
You can’t perform that action at this time.
0 commit comments