| 13 | // Helper method to test async errors to be thrown, as Jasmine doesn't have |
| 14 | // support for such matcher. |
| 15 | async function expectToThrowErrorAsync(f) { |
| 16 | if (typeof f !== 'function') { |
| 17 | throw new Error( |
| 18 | `expectToThrowErrorAsync: Type of parameter "f" is not "function" but "${typeof f}" instead.` |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | let errorMessage = ''; |
| 23 | try { |
| 24 | await f(); |
| 25 | } catch (error) { |
| 26 | errorMessage = error.message; |
| 27 | console.log(errorMessage); |
| 28 | } |
| 29 | |
| 30 | expect(errorMessage).not.toBe(''); |
| 31 | } |
| 32 | |
| 33 | describe('CLI key parsing', () => { |
| 34 | afterEach(() => { |