瀏覽代碼

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

GitOrigin-RevId: e6ba7d25436c1350f8eef74df34dce03f93af909
Antoine Clausse 10 月之前
父節點
當前提交
1b8a183430
共有 1 個文件被更改,包括 7 次插入10 次删除
  1. 7 10
      services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateHandler.test.mjs

+ 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
+    )
   })
 }