Skip to content

Commit c08f390

Browse files
committed
Run all tests with mocha after all
1 parent f139495 commit c08f390

22 files changed

+720
-709
lines changed

scripts/test.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ if (process.argv.includes("-mocha")) {
2222
mochaTest = true;
2323
}
2424

25-
if (process.argv.includes("-node")) {
26-
nodeTest = true;
27-
}
28-
2925
if (process.argv.includes("-bsb")) {
3026
bsbTest = true;
3127
}
@@ -61,31 +57,23 @@ async function runTests() {
6157
});
6258
}
6359

64-
if (mochaTest || nodeTest) {
60+
if (mochaTest) {
6561
cp.execSync(rescript_exe, {
6662
cwd: path.join(__dirname, "..", "tests/tests"),
6763
stdio: [0, 1, 2],
6864
});
65+
6966
cp.execSync(rescript_exe, {
7067
cwd: path.join(__dirname, "..", "tests/tests_esmodule"),
7168
stdio: [0, 1, 2],
7269
});
73-
}
7470

75-
if (mochaTest) {
7671
cp.execSync(`npx mocha -t 10000 tests/tests/**/*_test.js`, {
7772
cwd: path.join(__dirname, ".."),
7873
stdio: [0, 1, 2],
7974
});
8075
}
8176

82-
if (nodeTest) {
83-
cp.execSync(`node --test tests/tests/**/*_ntest.js`, {
84-
cwd: path.join(__dirname, ".."),
85-
stdio: [0, 1, 2],
86-
});
87-
}
88-
8977
if (bsbTest) {
9078
console.log("Doing build_tests");
9179
const buildTestDir = path.join(__dirname, "..", "tests", "build_tests");

tests/tests/src/belt_float_ntest.js

-46
This file was deleted.

tests/tests/src/belt_float_test.js

+46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/tests/src/belt_float_ntest.res tests/tests/src/belt_float_test.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
open Node_test
2-
open Node_test_util
1+
open Mocha
2+
open Test_utils
33

44
module F = Belt.Float
55

6-
describe("Belt.Float", () => {
6+
describe(__MODULE__, () => {
77
test("fromInt", () => {
88
eq(__LOC__, F.fromInt(1), 1.0)
99
eq(__LOC__, F.fromInt(-1), -1.0)

tests/tests/src/belt_hashmap_ntest.js tests/tests/src/belt_hashmap_test.js

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/tests/src/belt_hashmap_ntest.res tests/tests/src/belt_hashmap_test.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
open Node_test
2-
open Node_test_util
1+
open Mocha
2+
open Test_utils
33

44
module N = Belt.HashMap
55
module S = Belt.Map.Int
@@ -13,7 +13,7 @@ let cmp = (x: int, y) => compare(x, y)
1313
module Y = unpack(Belt.Id.hashable(~eq=intEq, ~hash=intHash))
1414
let empty: N.t<int, int, _> = N.make(~id=module(Y), ~hintSize=30)
1515

16-
describe("Belt.HashMap", () => {
16+
describe(__MODULE__, () => {
1717
test("fromArray", () => {
1818
let u = A.concat(I.randomRange(30, 100), I.randomRange(40, 120))
1919
let v = A.zip(u, u)

tests/tests/src/belt_hashset_int_ntest.js tests/tests/src/belt_hashset_int_test.js

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/tests/src/belt_hashset_int_ntest.res tests/tests/src/belt_hashset_int_test.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
open Node_test
2-
open Node_test_util
1+
open Mocha
2+
open Test_utils
33

44
module N = Belt.HashSet.Int
55
module S = Belt.Set.Int
@@ -15,7 +15,7 @@ let sum2 = h => {
1515
v.contents
1616
}
1717

18-
describe("Belt.HashSet.Int", () => {
18+
describe(__MODULE__, () => {
1919
test("fromArray", () => {
2020
let u = A.concat(I.randomRange(30, 100), I.randomRange(40, 120))
2121
let v = N.fromArray(u)

tests/tests/src/belt_int_ntest.js

-45
This file was deleted.

0 commit comments

Comments
 (0)