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/exposeDependency.js | 38 ++++++++++++---------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'test/unit/data/composite/exposeDependency.js') diff --git a/test/unit/data/composite/exposeDependency.js b/test/unit/data/composite/exposeDependency.js index 7487e44c..78801343 100644 --- a/test/unit/data/composite/exposeDependency.js +++ b/test/unit/data/composite/exposeDependency.js @@ -52,29 +52,23 @@ t.test(`exposeDependency: basic behavior`, t => { t.test(`exposeDependency: validate inputs`, t => { t.plan(2); - let caughtError; - - try { - caughtError = null; - exposeDependency({}); - } catch (error) { - caughtError = error; - } - - t.match(caughtError, { - errors: [/Required these inputs: dependency/], - }); + t.throws( + () => exposeDependency({}), + { + message: `Errors in input options passed to exposeDependency`, + errors: [ + {message: `Required these inputs: dependency`}, + ], + }); - try { - caughtError = null; - exposeDependency({ + t.throws( + () => exposeDependency({ dependency: input.value('some static value'), + }), + { + message: `Errors in input options passed to exposeDependency`, + errors: [ + {message: `dependency: Expected dependency name, got input.value() call`}, + ], }); - } catch (error) { - caughtError = error; - } - - t.match(caughtError, { - errors: [/Expected static dependencies: dependency/], - }); }); -- cgit 1.3.0-6-gf8a5