Skip to content

Commit 4d70a14

Browse files
committed
Test wait-empty-event-loop only when supported
1 parent 7a3a2d0 commit 4d70a14

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/test.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -557,15 +557,17 @@ describe("- Testing cli.js", function () {
557557
assert.equal(r.output, "");
558558
});
559559
});
560-
describe("* Test --wait-empty-event-loop", function () {
561-
it("should wait for all timeouts to end", function () {
562-
var command = get_shell("node ../build/cli.js -l ./functs/test-func-waitemptyloop.js -e ./events/test-event.js --wait-empty-event-loop");
563-
var r = spawnSync(command[0], command[1]);
564-
process_outputs(r);
565-
assert.equal(r.status, 0);
566-
assert.equal((r.output.indexOf("Timeout finished !") !== -1), true)
560+
if (get_node_major_version() >= 16) {
561+
describe("* Test --wait-empty-event-loop", function () {
562+
it("should wait for all timeouts to end", function () {
563+
var command = get_shell("node ../build/cli.js -l ./functs/test-func-waitemptyloop.js -e ./events/test-event.js --wait-empty-event-loop");
564+
var r = spawnSync(command[0], command[1]);
565+
process_outputs(r);
566+
assert.equal(r.status, 0);
567+
assert.equal((r.output.indexOf("Timeout finished !") !== -1), true)
568+
});
567569
});
568-
});
570+
}
569571
describe("* Test --version", function () {
570572
var lambdalocal = require(lambdalocal_path);
571573
it("should match the current latest version", function () {

0 commit comments

Comments
 (0)