提交 bd66f3ff 编写于 作者: C Christof Marti

Randomize test name to avoid collision when executing in parallel (fixes #42614)

上级 8fcc35f7
......@@ -17,10 +17,20 @@ suite('Keytar', () => {
}
(async () => {
const keytar = await import('keytar');
await keytar.setPassword('VSCode Test', 'foo', 'bar');
assert.equal(await keytar.getPassword('VSCode Test', 'foo'), 'bar');
await keytar.deletePassword('VSCode Test', 'foo');
assert.equal(await keytar.getPassword('VSCode Test', 'foo'), undefined);
const name = `VSCode Test ${Math.floor(Math.random() * 1e9)}`;
try {
await keytar.setPassword(name, 'foo', 'bar');
assert.equal(await keytar.getPassword(name, 'foo'), 'bar');
await keytar.deletePassword(name, 'foo');
assert.equal(await keytar.getPassword(name, 'foo'), undefined);
} catch (err) {
// try to clean up
try {
await keytar.deletePassword(name, 'foo');
} finally {
throw err;
}
}
})().then(done, done);
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册