(src: string)
| 118 | |
| 119 | describe('callstack', () => { |
| 120 | const exeAndGetErrMessage = (src: string): Promise<string> => new Promise((ok, ng) => { |
| 121 | const aiscript = new Interpreter({ |
| 122 | emitError: FN_NATIVE((_args, _opts) => { |
| 123 | throw Error('emitError'); |
| 124 | }), |
| 125 | }, { |
| 126 | err(e) { ok(e.message) }, |
| 127 | }); |
| 128 | aiscript.exec(Parser.parse(src)).then(() => ng('error has not occurred.')); |
| 129 | }); |
| 130 | |
| 131 | test('error in function', async () => { |
| 132 | const result = await exeAndGetErrMessage(` |
no test coverage detected