diff --git a/jscomp/build_tests/weird_names/input.js b/jscomp/build_tests/weird_names/input.js index 08bc83c3ef..f9643f723c 100644 --- a/jscomp/build_tests/weird_names/input.js +++ b/jscomp/build_tests/weird_names/input.js @@ -5,7 +5,6 @@ var rescript_exe = require("../../../scripts/bin_path").rescript_exe; var out = cp.spawnSync(rescript_exe, { encoding: "utf8" }); -console.log(out.stdout); if (out.stderr !== "") { assert.fail(out.stderr); } @@ -17,11 +16,11 @@ let files = [ "[[...params]].res", "[slug_or_ID].res", "404.res", + "utils.test.res", ]; for (let f of files) { let { name } = path.parse(f); let m = `./lib/js/src/${name}.js`; - // console.log(m); assert.deepEqual(require(m).a, 1); } diff --git a/jscomp/build_tests/weird_names/src/utils.test.res b/jscomp/build_tests/weird_names/src/utils.test.res new file mode 100644 index 0000000000..c311b2ea80 --- /dev/null +++ b/jscomp/build_tests/weird_names/src/utils.test.res @@ -0,0 +1,2 @@ +module A = Demo +let a = 1 \ No newline at end of file diff --git a/jscomp/build_tests/weird_names_not_found_bug/bsconfig.json b/jscomp/build_tests/weird_names_not_found_bug/bsconfig.json new file mode 100644 index 0000000000..1923c110eb --- /dev/null +++ b/jscomp/build_tests/weird_names_not_found_bug/bsconfig.json @@ -0,0 +1,8 @@ +{ + "name": "weird_names", + "version": "0.1.0", + "sources": { + "dir" : "src", + "subdirs" : true + } +} diff --git a/jscomp/build_tests/weird_names_not_found_bug/input.js b/jscomp/build_tests/weird_names_not_found_bug/input.js new file mode 100644 index 0000000000..1442695959 --- /dev/null +++ b/jscomp/build_tests/weird_names_not_found_bug/input.js @@ -0,0 +1,12 @@ +var cp = require("child_process"); +var assert = require("assert"); +var rescript_exe = require("../../../scripts/bin_path").rescript_exe; + +var out = cp.spawnSync(rescript_exe, { encoding: "utf8" }); +if (out.stderr !== "") { + assert.fail(out.stderr); +} + +if (!out.stdout.includes(`The module or file Demo can't be found.`)) { + assert.fail(out.stdout); +} diff --git a/jscomp/build_tests/weird_names_not_found_bug/src/demo.res b/jscomp/build_tests/weird_names_not_found_bug/src/demo.res new file mode 100644 index 0000000000..67bbe3ba8e --- /dev/null +++ b/jscomp/build_tests/weird_names_not_found_bug/src/demo.res @@ -0,0 +1 @@ +let a = 1 diff --git a/jscomp/build_tests/weird_names_not_found_bug/src/demo.test.res b/jscomp/build_tests/weird_names_not_found_bug/src/demo.test.res new file mode 100644 index 0000000000..c311b2ea80 --- /dev/null +++ b/jscomp/build_tests/weird_names_not_found_bug/src/demo.test.res @@ -0,0 +1,2 @@ +module A = Demo +let a = 1 \ No newline at end of file diff --git a/scripts/ciTest.js b/scripts/ciTest.js index c764403c92..b1639e893e 100644 --- a/scripts/ciTest.js +++ b/scripts/ciTest.js @@ -79,8 +79,8 @@ function runTests() { console.log(stdout); if (error !== null) { - console.log(stderr); - throw new Error(`❌ error in ${file}: \n${error} `); + console.log(`❌ error in ${file} with stderr:\n`, stderr); + throw error; } else { console.log("✅ success in", file); }