MCPcopy Index your code
hub / github.com/aiscript-dev/aiscript / exeAndGetErrMessage

Function exeAndGetErrMessage

test/interpreter.ts:120–129  ·  view source on GitHub ↗
(src: string)

Source from the content-addressed store, hash-verified

118
119describe('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(`

Callers 1

interpreter.tsFile · 0.85

Calls 3

execMethod · 0.95
FN_NATIVEFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected