From ef290302472bd66ff9823aad1a4e029a4b4e2eba Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 28 Sep 2023 14:13:09 -0300 Subject: test: templateCompositeFrom (WIP), various composite test updates --- test/unit/data/composite/exposeConstant.js | 38 ++++++++++++------------------ 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'test/unit/data/composite/exposeConstant.js') diff --git a/test/unit/data/composite/exposeConstant.js b/test/unit/data/composite/exposeConstant.js index ce3f5e3d..829dc706 100644 --- a/test/unit/data/composite/exposeConstant.js +++ b/test/unit/data/composite/exposeConstant.js @@ -32,29 +32,21 @@ t.test(`exposeConstant: basic behavior`, t => { t.test(`exposeConstant: validate inputs`, t => { t.plan(2); - let caughtError; - - try { - caughtError = null; - exposeConstant({}); - } catch (error) { - caughtError = error; - } - - t.match(caughtError, { - errors: [/Required these inputs: value/], - }); - - try { - caughtError = null; - exposeConstant({ - value: 'some dependency', + t.throws( + () => exposeConstant({}), + { + message: `Errors in input options passed to exposeConstant`, + errors: [ + {message: `Required these inputs: value`}, + ], }); - } catch (error) { - caughtError = error; - } - t.match(caughtError, { - errors: [/Expected static values: value/], - }); + t.throws( + () => exposeConstant({value: 'some dependency'}), + { + message: `Errors in input options passed to exposeConstant`, + errors: [ + {message: `value: Expected input.value() call, got dependency name`}, + ], + }); }); -- cgit 1.3.0-6-gf8a5