(name, state)
| 49 | }; |
| 50 | |
| 51 | const 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 | |
| 61 | describe('Cloud KMS samples', () => { |
| 62 | before(async () => { |