(fn)
| 28 | }) |
| 29 | |
| 30 | function withErrorScope(fn) { |
| 31 | return async () => { |
| 32 | device.pushErrorScope('validation'); |
| 33 | await fn(); |
| 34 | const error = await device.popErrorScope(); |
| 35 | assert(!error, `device error: ${error?.message || error}`); |
| 36 | }; |
| 37 | } |
| 38 | |
| 39 | await it('creates a device', withErrorScope(async () => { |
| 40 | console.log('adapter.info.description:', adapter.info.description); |