MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / waitForImportJobState

Function waitForImportJobState

kms/test/kms.test.js:51–59  ·  view source on GitHub ↗
(name, state)

Source from the content-addressed store, hash-verified

49};
50
51const waitForImportJobState = async (name, state) => {
52 const sleep = w => new Promise(r => setTimeout(r, w));
53
54 let [importJob] = await client.getImportJob({name});
55 while (importJob.state !== state) {
56 await sleep(100);
57 [importJob] = await client.getImportJob({name});
58 }
59};
60
61describe('Cloud KMS samples', () => {
62 before(async () => {

Callers 1

kms.test.jsFile · 0.85

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected