From 5cecc720c23d58d274d27e91673fc7e20c2a31bf Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Wed, 27 Nov 2019 16:13:46 +0100 Subject: [PATCH] [INTERNAL] SapUiDefine: Add failing test for error improved handling --- test/lib/lbt/calls/SapUiDefine.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/lib/lbt/calls/SapUiDefine.js b/test/lib/lbt/calls/SapUiDefine.js index 38b5e7636..061e72a7b 100644 --- a/test/lib/lbt/calls/SapUiDefine.js +++ b/test/lib/lbt/calls/SapUiDefine.js @@ -59,3 +59,11 @@ test("Find Import Name (no dependencies)", (t) => { const call = new SapUiDefineCall(ast, "FileSystemName"); t.is(call.findImportName("wanted.js"), null); }); + +test("Error handling: Unexpected array in dependencies parameter", (t) => { + const ast = parse("sap.ui.define(['a', 'b', ['c']], function(a,b,c) {});"); + const error = t.throws(()=> { + new SapUiDefineCall(ast, "FileSystemName"); + }); + t.deepEqual(error.message, ""); +});