Просмотр исходного кода

[web] Prevent errors from silently resolving and simplify promises in tests (#28621)

GitOrigin-RevId: e6ba7d25436c1350f8eef74df34dce03f93af909
Antoine Clausse 10 месяцев назад
Родитель
Сommit
1b8a183430

+ 7 - 10
services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandler.test.mjs

@@ -492,16 +492,13 @@ function receiveFileDelete() {
 
 function receiveFileDeleteById() {
   beforeEach(async function (ctx) {
-    await new Promise(resolve => {
-      ctx.TpdsUpdateHandler.deleteUpdate(
-        ctx.userId,
-        ctx.projectId,
-        '', // projectName
-        ctx.path,
-        ctx.source,
-        resolve
-      )
-    })
+    await ctx.TpdsUpdateHandler.promises.deleteUpdate(
+      ctx.userId,
+      ctx.projectId,
+      '', // projectName
+      ctx.path,
+      ctx.source
+    )
   })
 }