From 31c2fe56f48ce1174d5653ebb22a0cc9a85b99b5 Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Fri, 4 Dec 2020 15:54:46 -0600 Subject: [PATCH] yarn test-electron: automatically pick up test files --- preload.js | 16 ++++++++-------- ts/{test => test-node}/util/sortByTitle_test.ts | 0 2 files changed, 8 insertions(+), 8 deletions(-) rename ts/{test => test-node}/util/sortByTitle_test.ts (100%) diff --git a/preload.js b/preload.js index 7d86b9332..7e9079db3 100644 --- a/preload.js +++ b/preload.js @@ -563,20 +563,20 @@ try { }; /* eslint-disable global-require, import/no-extraneous-dependencies */ - require('./ts/test-both/state/ducks/conversations_test'); - require('./ts/test-both/state/selectors/conversations_test'); - require('./ts/test-both/state/selectors/items_test'); + const fastGlob = require('fast-glob'); - require('./ts/test-electron/linkPreviews/linkPreviewFetch_test'); - require('./ts/test-electron/models/messages_test'); - require('./ts/test-electron/state/ducks/calling_test'); - require('./ts/test-electron/state/selectors/calling_test'); + fastGlob + .sync('./ts/test-{both,electron}/**/*_test.js', { + absolute: true, + cwd: __dirname, + }) + .forEach(require); delete window.describe; window.test = { pendingDescribeCalls, - fastGlob: require('fast-glob'), + fastGlob, normalizePath: require('normalize-path'), fse: require('fs-extra'), tmp: require('tmp'), diff --git a/ts/test/util/sortByTitle_test.ts b/ts/test-node/util/sortByTitle_test.ts similarity index 100% rename from ts/test/util/sortByTitle_test.ts rename to ts/test-node/util/sortByTitle_test.ts