diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-09-28 14:13:09 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-09-28 14:13:09 -0300 |
commit | ef290302472bd66ff9823aad1a4e029a4b4e2eba (patch) | |
tree | c45656c75fc156da8b5df2f95ef04f54cff84c39 /test/unit/data/composite/exposeConstant.js | |
parent | f7376bb5eb2671de7242872ec0c4615b5e244aba (diff) |
test: templateCompositeFrom (WIP), various composite test updates
Diffstat (limited to 'test/unit/data/composite/exposeConstant.js')
-rw-r--r-- | test/unit/data/composite/exposeConstant.js | 38 |
1 files changed, 15 insertions, 23 deletions
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`}, + ], + }); }); |