« 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/exposeDependency.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/data/composite/exposeDependency.js')
-rw-r--r--test/unit/data/composite/exposeDependency.js38
1 files changed, 16 insertions, 22 deletions
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/],
-  });
 });