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

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

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