« get me outta code hell

clean up imports & miscellaneous metastructures across codebase - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-19 14:13:31 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-19 14:13:31 -0300
commitef8acc5d50fa3c23bd7c9d4bb720b7ff78581981 (patch)
tree6c061e3771cb47619ce9163b559053504a000641 /test
parent37ef3f288fce9bd65a2cd86107239e22f977e78d (diff)
clean up imports & miscellaneous metastructures across codebase
Diffstat (limited to 'test')
-rw-r--r--test/lib/content-function.js22
-rw-r--r--test/lib/generic-mock.js2
-rw-r--r--test/lib/index.js3
-rw-r--r--test/snapshot/generateAdditionalFilesList.js2
-rw-r--r--test/snapshot/generateAdditionalFilesShortcut.js2
-rw-r--r--test/snapshot/generateAlbumBanner.js2
-rw-r--r--test/snapshot/generateAlbumCoverArtwork.js2
-rw-r--r--test/snapshot/generateAlbumReleaseInfo.js2
-rw-r--r--test/snapshot/generateAlbumSecondaryNav.js2
-rw-r--r--test/snapshot/generateAlbumSidebarGroupBox.js2
-rw-r--r--test/snapshot/generateAlbumTrackList.js2
-rw-r--r--test/snapshot/generateBanner.js2
-rw-r--r--test/snapshot/generateCoverArtwork.js2
-rw-r--r--test/snapshot/generatePreviousNextLinks.js5
-rw-r--r--test/snapshot/generateTrackCoverArtwork.js2
-rw-r--r--test/snapshot/generateTrackReleaseInfo.js2
-rw-r--r--test/snapshot/image.js2
-rw-r--r--test/snapshot/linkArtist.js2
-rw-r--r--test/snapshot/linkContribution.js2
-rw-r--r--test/snapshot/linkExternal.js2
-rw-r--r--test/snapshot/linkExternalFlash.js2
-rw-r--r--test/snapshot/linkTemplate.js2
-rw-r--r--test/snapshot/transformContent.js2
-rw-r--r--test/unit/content/dependencies/generateAlbumTrackList.js2
-rw-r--r--test/unit/content/dependencies/linkArtist.js2
-rw-r--r--test/unit/content/dependencies/linkContribution.js2
-rw-r--r--test/unit/data/things/cacheable-object.js2
-rw-r--r--test/unit/data/things/track.js3
-rw-r--r--test/unit/data/things/validators.js4
-rw-r--r--test/unit/util/html.js6
30 files changed, 46 insertions, 45 deletions
diff --git a/test/lib/content-function.js b/test/lib/content-function.js
index a9e5f44..bb12be8 100644
--- a/test/lib/content-function.js
+++ b/test/lib/content-function.js
@@ -1,17 +1,17 @@
+import * as path from 'node:path';
+import {fileURLToPath} from 'node:url';
+
 import chroma from 'chroma-js';
-import * as path from 'path';
-import {fileURLToPath} from 'url';
+
+import {getColors} from '#colors';
+import {quickLoadContentDependencies} from '#content-dependencies';
+import {quickEvaluate} from '#content-function';
+import * as html from '#html';
+import {processLanguageFile} from '#language';
+import {empty, showAggregate} from '#sugar';
+import {generateURLs, thumb, urlSpec} from '#urls';
 
 import mock from './generic-mock.js';
-import {quickEvaluate} from '../../src/content-function.js';
-import {quickLoadContentDependencies} from '../../src/content/dependencies/index.js';
-
-import urlSpec from '../../src/url-spec.js';
-import * as html from '../../src/util/html.js';
-import {empty, showAggregate} from '../../src/util/sugar.js';
-import {getColors} from '../../src/util/colors.js';
-import {generateURLs, thumb} from '../../src/util/urls.js';
-import {processLanguageFile} from '../../src/data/language.js';
 
 const __dirname = path.dirname(fileURLToPath(import.meta.url));
 
diff --git a/test/lib/generic-mock.js b/test/lib/generic-mock.js
index 119f873..28309ab 100644
--- a/test/lib/generic-mock.js
+++ b/test/lib/generic-mock.js
@@ -1,6 +1,6 @@
 import {same} from 'tcompare';
 
-import {empty} from '../../src/util/sugar.js';
+import {empty} from '#sugar';
 
 export default function mock(callback) {
   const mocks = [];
diff --git a/test/lib/index.js b/test/lib/index.js
new file mode 100644
index 0000000..b9cc82f
--- /dev/null
+++ b/test/lib/index.js
@@ -0,0 +1,3 @@
+export * from './content-function.js';
+export * from './generic-mock.js';
+export * from './strict-match-error.js';
diff --git a/test/snapshot/generateAdditionalFilesList.js b/test/snapshot/generateAdditionalFilesList.js
index 60b46ae..3ea1c37 100644
--- a/test/snapshot/generateAdditionalFilesList.js
+++ b/test/snapshot/generateAdditionalFilesList.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAdditionalFilesList (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateAdditionalFilesShortcut.js b/test/snapshot/generateAdditionalFilesShortcut.js
index 0ca777b..9825efa 100644
--- a/test/snapshot/generateAdditionalFilesShortcut.js
+++ b/test/snapshot/generateAdditionalFilesShortcut.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAdditionalFilesShortcut (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateAlbumBanner.js b/test/snapshot/generateAlbumBanner.js
index e2260cd..8e63308 100644
--- a/test/snapshot/generateAlbumBanner.js
+++ b/test/snapshot/generateAlbumBanner.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumBanner (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateAlbumCoverArtwork.js b/test/snapshot/generateAlbumCoverArtwork.js
index 150b12b..98632d3 100644
--- a/test/snapshot/generateAlbumCoverArtwork.js
+++ b/test/snapshot/generateAlbumCoverArtwork.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumCoverArtwork (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateAlbumReleaseInfo.js b/test/snapshot/generateAlbumReleaseInfo.js
index 7e3b37b..3dea119 100644
--- a/test/snapshot/generateAlbumReleaseInfo.js
+++ b/test/snapshot/generateAlbumReleaseInfo.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumReleaseInfo (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateAlbumSecondaryNav.js b/test/snapshot/generateAlbumSecondaryNav.js
index 180cb6e..a5cb2e9 100644
--- a/test/snapshot/generateAlbumSecondaryNav.js
+++ b/test/snapshot/generateAlbumSecondaryNav.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumSecondaryNav (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateAlbumSidebarGroupBox.js b/test/snapshot/generateAlbumSidebarGroupBox.js
index 5234823..8785051 100644
--- a/test/snapshot/generateAlbumSidebarGroupBox.js
+++ b/test/snapshot/generateAlbumSidebarGroupBox.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumSidebarGroupBox (snapshot)', async (t, evaluate) => {
   await evaluate.load({
diff --git a/test/snapshot/generateAlbumTrackList.js b/test/snapshot/generateAlbumTrackList.js
index ea3cfef..904ba98 100644
--- a/test/snapshot/generateAlbumTrackList.js
+++ b/test/snapshot/generateAlbumTrackList.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumTrackList (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateBanner.js b/test/snapshot/generateBanner.js
index 587ce04..ab57c3c 100644
--- a/test/snapshot/generateBanner.js
+++ b/test/snapshot/generateBanner.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateBanner (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateCoverArtwork.js b/test/snapshot/generateCoverArtwork.js
index 025a6d0..21c9145 100644
--- a/test/snapshot/generateCoverArtwork.js
+++ b/test/snapshot/generateCoverArtwork.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateCoverArtwork (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generatePreviousNextLinks.js b/test/snapshot/generatePreviousNextLinks.js
index d0b6107..0d952f5 100644
--- a/test/snapshot/generatePreviousNextLinks.js
+++ b/test/snapshot/generatePreviousNextLinks.js
@@ -1,7 +1,6 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
-
-import * as html from '../../src/util/html.js';
+import * as html from '#html';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generatePreviousNextLinks (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateTrackCoverArtwork.js b/test/snapshot/generateTrackCoverArtwork.js
index bfefb5f..9e15470 100644
--- a/test/snapshot/generateTrackCoverArtwork.js
+++ b/test/snapshot/generateTrackCoverArtwork.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateTrackCoverArtwork (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/generateTrackReleaseInfo.js b/test/snapshot/generateTrackReleaseInfo.js
index 5556f38..c72344b 100644
--- a/test/snapshot/generateTrackReleaseInfo.js
+++ b/test/snapshot/generateTrackReleaseInfo.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateTrackReleaseInfo (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/image.js b/test/snapshot/image.js
index 62e1cd9..6bec1cc 100644
--- a/test/snapshot/image.js
+++ b/test/snapshot/image.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'image (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/linkArtist.js b/test/snapshot/linkArtist.js
index 684affc..7b2114b 100644
--- a/test/snapshot/linkArtist.js
+++ b/test/snapshot/linkArtist.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'linkArtist (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/linkContribution.js b/test/snapshot/linkContribution.js
index ccb7467..ad5fb41 100644
--- a/test/snapshot/linkContribution.js
+++ b/test/snapshot/linkContribution.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'linkContribution (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/linkExternal.js b/test/snapshot/linkExternal.js
index 391d5a1..3e8aee0 100644
--- a/test/snapshot/linkExternal.js
+++ b/test/snapshot/linkExternal.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/linkExternalFlash.js b/test/snapshot/linkExternalFlash.js
index 7bb86c6..a4d44af 100644
--- a/test/snapshot/linkExternalFlash.js
+++ b/test/snapshot/linkExternalFlash.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'linkExternalFlash (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/linkTemplate.js b/test/snapshot/linkTemplate.js
index 83d7710..bdb9121 100644
--- a/test/snapshot/linkTemplate.js
+++ b/test/snapshot/linkTemplate.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'linkTemplate (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/snapshot/transformContent.js b/test/snapshot/transformContent.js
index 96181e8..2595285 100644
--- a/test/snapshot/transformContent.js
+++ b/test/snapshot/transformContent.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'transformContent (snapshot)', async (t, evaluate) => {
   await evaluate.load();
diff --git a/test/unit/content/dependencies/generateAlbumTrackList.js b/test/unit/content/dependencies/generateAlbumTrackList.js
index 80b086c..7b3ecd3 100644
--- a/test/unit/content/dependencies/generateAlbumTrackList.js
+++ b/test/unit/content/dependencies/generateAlbumTrackList.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../../../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumTrackList (unit)', async (t, evaluate) => {
   await evaluate.load({
diff --git a/test/unit/content/dependencies/linkArtist.js b/test/unit/content/dependencies/linkArtist.js
index 9fceb97..e6e19d2 100644
--- a/test/unit/content/dependencies/linkArtist.js
+++ b/test/unit/content/dependencies/linkArtist.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../../../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'linkArtist (unit)', async (t, evaluate) => {
   const artistObject = {};
diff --git a/test/unit/content/dependencies/linkContribution.js b/test/unit/content/dependencies/linkContribution.js
index bed2b6d..9490890 100644
--- a/test/unit/content/dependencies/linkContribution.js
+++ b/test/unit/content/dependencies/linkContribution.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import {testContentFunctions} from '../../../lib/content-function.js';
+import {testContentFunctions} from '#test-lib';
 
 t.test('generateContributionLinks (unit)', async t => {
   const who1 = {
diff --git a/test/unit/data/things/cacheable-object.js b/test/unit/data/things/cacheable-object.js
index d7a88ce..2e82af0 100644
--- a/test/unit/data/things/cacheable-object.js
+++ b/test/unit/data/things/cacheable-object.js
@@ -1,6 +1,6 @@
 import t from 'tap';
 
-import CacheableObject from '../../../../src/data/things/cacheable-object.js';
+import {CacheableObject} from '#things';
 
 function newCacheableObject(PD) {
   return new (class extends CacheableObject {
diff --git a/test/unit/data/things/track.js b/test/unit/data/things/track.js
index 0dad0e6..383e3e3 100644
--- a/test/unit/data/things/track.js
+++ b/test/unit/data/things/track.js
@@ -1,6 +1,5 @@
 import t from 'tap';
-
-import thingConstructors from '../../../../src/data/things/index.js';
+import thingConstructors from '#things';
 
 const {
   Album,
diff --git a/test/unit/data/things/validators.js b/test/unit/data/things/validators.js
index 53cba06..bb33bf8 100644
--- a/test/unit/data/things/validators.js
+++ b/test/unit/data/things/validators.js
@@ -1,5 +1,5 @@
 import t from 'tap';
-import { showAggregate } from '../../../../src/util/sugar.js';
+import {showAggregate} from '#sugar';
 
 import {
   // Basic types
@@ -31,7 +31,7 @@ import {
 
   // Compositional utilities
   oneOf,
-} from '../../../../src/data/things/validators.js';
+} from '#validators';
 
 function test(t, msg, fn) {
   t.test(msg, t => {
diff --git a/test/unit/util/html.js b/test/unit/util/html.js
index 9b30aeb..b5956e6 100644
--- a/test/unit/util/html.js
+++ b/test/unit/util/html.js
@@ -1,9 +1,9 @@
 import t from 'tap';
 
-import * as html from '../../../src/util/html.js';
-const {Tag, Attributes, Template} = html;
+import * as html from '#html';
+import {strictlyThrows} from '#test-lib';
 
-import {strictlyThrows} from '../../lib/strict-match-error.js';
+const {Tag, Attributes, Template} = html;
 
 t.test(`html.tag`, t => {
   t.plan(14);