From 2e8d09c87e0ce5c25fbd17b3656d52e14bb626a9 Mon Sep 17 00:00:00 2001 From: Yavor Ivanov Date: Tue, 14 Nov 2023 09:23:43 +0200 Subject: [PATCH] Add tests for enforcement flag --- test/lib/build/ProjectBuilder.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/lib/build/ProjectBuilder.js b/test/lib/build/ProjectBuilder.js index cf23257ba..c867accba 100644 --- a/test/lib/build/ProjectBuilder.js +++ b/test/lib/build/ProjectBuilder.js @@ -729,6 +729,14 @@ test("_executeCleanupTasks", async (t) => { t.is(executeCleanupTasksStub.callCount, 1, "BuildContext#executeCleanupTasks got called once"); t.deepEqual(executeCleanupTasksStub.getCall(0).args, [undefined], "BuildContext#executeCleanupTasks got called with no arguments"); + + // reset stub + executeCleanupTasksStub.reset(); + // Call with enforcement flag + await builder._executeCleanupTasks(true); + t.is(executeCleanupTasksStub.callCount, 1, "BuildContext#executeCleanupTasks got called once"); + t.deepEqual(executeCleanupTasksStub.getCall(0).args, [true], + "BuildContext#executeCleanupTasks got called with force flag"); }); test("instantiate new logger for every ProjectBuilder", async (t) => {