提交 ef0f143e 编写于 作者: Z zhaimengchao 提交者: 翟孟超

fixed 0eeff305 from https://gitee.com/zhaimengchao/xts_acts/pulls/8376

【account】【master】OnOff文件sleep方法重写
Signed-off-by: Nzhaimengchao <zhaimengchao@huawei.com>
上级 b7ee3082
...@@ -21,16 +21,16 @@ const TIMEOUT = 2000; ...@@ -21,16 +21,16 @@ 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.
先完成此消息的编辑!
想要评论请 注册