未验证 提交 b0b36cfd 编写于 作者: O openharmony_ci 提交者: Gitee

!8377 【Account】【3.2Release】OnOff文件sleep方法重写

Merge pull request !8377 from 翟孟超/cherry-pick-1680832483
...@@ -21,15 +21,15 @@ const TIMEOUT = 2000; ...@@ -21,15 +21,15 @@ const TIMEOUT = 2000;
export default function ActsAccountChangeOnOff() { export default function ActsAccountChangeOnOff() {
describe('ActsAccountChangeOnOff', async function () { describe('ActsAccountChangeOnOff', async function () {
function sleep(delay) { async function sleep(delay) {
return new Promise((resolve, reject) => { let timeoutId = null;
setTimeout(() => { var promise = new Promise((resolve, reject) => {
resolve() timeoutId = setTimeout(() => resolve("done!"), delay);
}, delay) });
}).then(() => { await promise
console.info(`sleep #{time} over ...`) clearTimeout(timeoutId)
})
} }
beforeAll(async function (done) { beforeAll(async function (done) {
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册