« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/unit/data/composite/exposeConstant.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/data/composite/exposeConstant.js')
-rw-r--r--test/unit/data/composite/exposeConstant.js38
1 files changed, 15 insertions, 23 deletions
diff --git a/test/unit/data/composite/exposeConstant.js b/test/unit/data/composite/exposeConstant.js
index ce3f5e3..829dc70 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`},
+      ],
+    });
 });