Skip to content

Commit 7e06c7b

Browse files
committed
add test case for install flag
Signed-Off-By: Jan Lindemann <[email protected]>
1 parent d6e6256 commit 7e06c7b

File tree

5 files changed

+97
-0
lines changed

5 files changed

+97
-0
lines changed

jscomp/build_tests/install/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*.exe
2+
*.obj
3+
*.out
4+
*.compile
5+
*.native
6+
*.byte
7+
*.cmo
8+
*.annot
9+
*.cmi
10+
*.cmx
11+
*.cmt
12+
*.cmti
13+
*.cma
14+
*.a
15+
*.cmxa
16+
*.obj
17+
*~
18+
*.annot
19+
*.cmj
20+
*.bak
21+
lib/bs
22+
*.mlast
23+
*.mliast
24+
.vscode
25+
.merlin
26+
*.bs.js
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "install",
3+
"version": "0.1.0",
4+
"sources": {
5+
"dir" : "src",
6+
"subdirs" : true
7+
},
8+
"package-specs": {
9+
"module": "commonjs",
10+
"in-source": true
11+
},
12+
"suffix": ".bs.js",
13+
"bs-dependencies": [
14+
],
15+
"warnings": {
16+
"error" : "+101"
17+
},
18+
"refmt": 3
19+
}
20+

jscomp/build_tests/install/input.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
var p = require("child_process");
2+
var fs = require("fs");
3+
var path = require("path");
4+
var assert = require("assert");
5+
6+
p.spawnSync(`bsb`, [`-clean`], {
7+
encoding: "utf8",
8+
cwd: __dirname,
9+
stdio: [0, 1, 2]
10+
});
11+
p.spawnSync(`bsb`, [`-install`], {
12+
encoding: "utf8",
13+
cwd: __dirname,
14+
stdio: [0, 1, 2]
15+
});
16+
17+
var fooExists = fs.existsSync(path.join(__dirname, "lib", "ocaml", "Foo.cmi"));
18+
assert.ok(fooExists == false);
19+
20+
p.spawnSync(`bsb`, {
21+
encoding: "utf8",
22+
cwd: __dirname,
23+
stdio: [0, 1, 2]
24+
});
25+
p.spawnSync(`bsb` ,[`-install`], {
26+
encoding: "utf8",
27+
cwd: __dirname,
28+
stdio: [0, 1, 2]
29+
});
30+
31+
fooExists = fs.existsSync(path.join(__dirname, "lib", "ocaml", "Foo.cmi"));
32+
assert.ok(fooExists);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "install",
3+
"version": "0.1.0",
4+
"scripts": {
5+
"clean": "bsb -clean-world",
6+
"build": "bsb -make-world",
7+
"install": "bsb -install",
8+
"watch": "bsb -make-world -w"
9+
},
10+
"keywords": [
11+
"BuckleScript"
12+
],
13+
"author": "",
14+
"license": "MIT",
15+
"devDependencies": {
16+
"bs-platform": "^5.1.0-dev.1"
17+
}
18+
}

jscomp/build_tests/install/src/Foo.re

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let main = () => Js.log("hello");

0 commit comments

Comments
 (0)