« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.taprc2
-rw-r--r--package.json2
-rw-r--r--test/lib/composite.js33
-rw-r--r--test/lib/index.js4
-rw-r--r--test/test-lib.js (renamed from test/lib/strict-match-error.js)36
5 files changed, 38 insertions, 39 deletions
diff --git a/.taprc b/.taprc
index 01ac7b62..3d4523f3 100644
--- a/.taprc
+++ b/.taprc
@@ -1,6 +1,6 @@
 # vim: set filetype=yaml :
 coverage-map: coverage-map.js
 exclude:
-  - test/lib/*
+  - test/test-lib.js
 test-env:
   - CLICOLOR_FORCE=0
diff --git a/package.json b/package.json
index 39b73e06..89b06003 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
         "#serialize": "./src/data/serialize.js",
         "#sort": "./src/common-util/sort.js",
         "#sugar": "./src/common-util/sugar.js",
-        "#test-lib": "./test/lib/index.js",
+        "#test-lib": "./test/test-lib.js",
         "#thing": "./src/data/thing.js",
         "#things": "./src/data/things/init.js",
         "#thumbs": "./src/gen-thumbs.js",
diff --git a/test/lib/composite.js b/test/lib/composite.js
deleted file mode 100644
index 359d364d..00000000
--- a/test/lib/composite.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import {compositeFrom} from '#composite';
-
-export function quickCheckCompositeOutputs(t, dependencies) {
-  return (step, outputDict) => {
-    t.same(
-      Object.keys(step.toDescription().outputs),
-      Object.keys(outputDict));
-
-    const composite = compositeFrom({
-      compose: false,
-      steps: [
-        step,
-
-        {
-          dependencies: Object.keys(outputDict),
-
-          // Access all dependencies by their expected keys -
-          // the composition runner actually provides a proxy
-          // and is checking that *we* access the dependencies
-          // we've specified.
-          compute: dependencies =>
-            Object.fromEntries(
-              Object.keys(outputDict)
-                .map(key => [key, dependencies[key]])),
-        },
-      ],
-    });
-
-    t.same(
-      composite.expose.compute(dependencies),
-      outputDict);
-  };
-}
diff --git a/test/lib/index.js b/test/lib/index.js
deleted file mode 100644
index 657bfe78..00000000
--- a/test/lib/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-Error.stackTraceLimit = Infinity;
-
-export * from './composite.js';
-export * from './strict-match-error.js';
diff --git a/test/lib/strict-match-error.js b/test/test-lib.js
index e3b36e93..a12974cd 100644
--- a/test/lib/strict-match-error.js
+++ b/test/test-lib.js
@@ -1,3 +1,39 @@
+import {compositeFrom} from '#composite';
+
+Error.stackTraceLimit = Infinity;
+
+export function quickCheckCompositeOutputs(t, dependencies) {
+  return (step, outputDict) => {
+    t.same(
+      Object.keys(step.toDescription().outputs),
+      Object.keys(outputDict));
+
+    const composite = compositeFrom({
+      compose: false,
+      steps: [
+        step,
+
+        {
+          dependencies: Object.keys(outputDict),
+
+          // Access all dependencies by their expected keys -
+          // the composition runner actually provides a proxy
+          // and is checking that *we* access the dependencies
+          // we've specified.
+          compute: dependencies =>
+            Object.fromEntries(
+              Object.keys(outputDict)
+                .map(key => [key, dependencies[key]])),
+        },
+      ],
+    });
+
+    t.same(
+      composite.expose.compute(dependencies),
+      outputDict);
+  };
+}
+
 export function strictlyThrows(t, fn, pattern) {
   const error = catchErrorOrNull(fn);