sxy-test-runner 1.4.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +24 -22
- package/dist/cli/init.js +41 -91
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/lib/addBasePath.d.ts.map +1 -1
- package/dist/cli/lib/addBasePath.js +12 -14
- package/dist/cli/lib/addBasePath.js.map +1 -1
- package/dist/cli/lib/addBasePath.unitTest.d.ts +2 -0
- package/dist/cli/lib/addBasePath.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/addBasePath.unitTest.js +51 -29
- package/dist/cli/lib/addBasePath.unitTest.js.map +1 -0
- package/dist/cli/lib/addExports.js +13 -11
- package/dist/cli/lib/addExports.unitTest.d.ts +2 -0
- package/dist/cli/lib/addExports.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/addExports.unitTest.js +15 -30
- package/dist/cli/lib/addExports.unitTest.js.map +1 -0
- package/dist/cli/lib/applyConfigDefaults.js +6 -42
- package/dist/cli/lib/applyConfigDefaults.js.map +1 -1
- package/dist/cli/lib/applyConfigDefaults.unitTest.d.ts +2 -0
- package/dist/cli/lib/applyConfigDefaults.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/applyConfigDefaults.unitTest.js +19 -27
- package/dist/cli/lib/applyConfigDefaults.unitTest.js.map +1 -0
- package/dist/cli/lib/buildDependencyTree.js +23 -34
- package/dist/cli/lib/buildDependencyTree.js.map +1 -1
- package/dist/cli/lib/buildDependencyTree.unitTest.d.ts +2 -0
- package/dist/cli/lib/buildDependencyTree.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/buildDependencyTree.unitTest.js +13 -11
- package/dist/cli/lib/buildDependencyTree.unitTest.js.map +1 -0
- package/dist/cli/lib/buildDependencyTrees.js +15 -34
- package/dist/cli/lib/buildDependencyTrees.js.map +1 -1
- package/dist/cli/lib/buildDependencyTrees.unitTest.d.ts +2 -0
- package/dist/cli/lib/buildDependencyTrees.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/buildDependencyTrees.unitTest.js +18 -14
- package/dist/cli/lib/buildDependencyTrees.unitTest.js.map +1 -0
- package/dist/cli/lib/defaultConfig.js +23 -21
- package/dist/cli/lib/defaultConfig.unitTest.d.ts +2 -0
- package/dist/cli/lib/defaultConfig.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/defaultConfig.unitTest.js +7 -0
- package/dist/cli/lib/defaultConfig.unitTest.js.map +1 -0
- package/dist/cli/lib/doUserSetup.d.ts +1 -1
- package/dist/cli/lib/doUserSetup.d.ts.map +1 -1
- package/dist/cli/lib/doUserSetup.js +20 -23
- package/dist/cli/lib/doUserSetup.js.map +1 -1
- package/dist/cli/lib/doUserSetup.unitTest.d.ts +7 -0
- package/dist/cli/lib/doUserSetup.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/doUserSetup.unitTest.js +41 -36
- package/dist/cli/lib/doUserSetup.unitTest.js.map +1 -0
- package/dist/cli/lib/doUserTeardown.d.ts +1 -1
- package/dist/cli/lib/doUserTeardown.d.ts.map +1 -1
- package/dist/cli/lib/doUserTeardown.js +21 -23
- package/dist/cli/lib/doUserTeardown.js.map +1 -1
- package/dist/cli/lib/doUserTeardown.unitTest.d.ts +7 -0
- package/dist/cli/lib/doUserTeardown.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/doUserTeardown.unitTest.js +41 -36
- package/dist/cli/lib/doUserTeardown.unitTest.js.map +1 -0
- package/dist/cli/lib/findTestFiles.d.ts.map +1 -1
- package/dist/cli/lib/findTestFiles.js +16 -24
- package/dist/cli/lib/findTestFiles.js.map +1 -1
- package/dist/cli/lib/findTestFiles.unitTest.d.ts +2 -0
- package/dist/cli/lib/findTestFiles.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/findTestFiles.unitTest.js +19 -19
- package/dist/cli/lib/findTestFiles.unitTest.js.map +1 -0
- package/dist/cli/lib/getAllowedFlags.js +10 -8
- package/dist/cli/lib/getAllowedFlags.unitTest.d.ts +2 -0
- package/dist/cli/lib/getAllowedFlags.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/getAllowedFlags.unitTest.js +22 -21
- package/dist/cli/lib/getAllowedFlags.unitTest.js.map +1 -0
- package/dist/cli/lib/globArgCombine.js +8 -1
- package/dist/cli/lib/globArgCombine.unitTest.d.ts +2 -0
- package/dist/cli/lib/globArgCombine.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/globArgCombine.unitTest.js +19 -18
- package/dist/cli/lib/globArgCombine.unitTest.js.map +1 -0
- package/dist/cli/lib/injectProperties.d.ts.map +1 -1
- package/dist/cli/lib/injectProperties.js +10 -10
- package/dist/cli/lib/injectProperties.js.map +1 -1
- package/dist/cli/lib/injectProperties.unitTest.d.ts +2 -0
- package/dist/cli/lib/injectProperties.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/injectProperties.unitTest.js +19 -81
- package/dist/cli/lib/injectProperties.unitTest.js.map +1 -0
- package/dist/cli/lib/loadConfig.js +14 -18
- package/dist/cli/lib/loadConfig.js.map +1 -1
- package/dist/cli/lib/loadConfig.unitTest.d.ts +2 -0
- package/dist/cli/lib/loadConfig.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/loadConfig.unitTest.js +15 -15
- package/dist/cli/lib/loadConfig.unitTest.js.map +1 -0
- package/dist/cli/lib/loadTestFile.js +48 -78
- package/dist/cli/lib/loadTestFile.js.map +1 -1
- package/dist/cli/lib/loadTestFile.unitTest.d.ts +2 -0
- package/dist/cli/lib/loadTestFile.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/loadTestFile.unitTest.js +12 -49
- package/dist/cli/lib/loadTestFile.unitTest.js.map +1 -0
- package/dist/cli/lib/parseCommandLineArguments.js +48 -42
- package/dist/cli/lib/parseCommandLineArguments.unitTest.d.ts +2 -0
- package/dist/cli/lib/parseCommandLineArguments.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/parseCommandLineArguments.unitTest.js +22 -24
- package/dist/cli/lib/parseCommandLineArguments.unitTest.js.map +1 -0
- package/dist/cli/lib/parseDescribe.d.ts.map +1 -1
- package/dist/cli/lib/parseDescribe.js +67 -81
- package/dist/cli/lib/parseDescribe.js.map +1 -1
- package/dist/cli/lib/parseDescribe.unitTest.d.ts +2 -0
- package/dist/cli/lib/parseDescribe.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/parseDescribe.unitTest.js +20 -18
- package/dist/cli/lib/parseDescribe.unitTest.js.map +1 -0
- package/dist/cli/lib/reservedExportKeys.d.ts +2 -0
- package/dist/cli/lib/reservedExportKeys.d.ts.map +1 -0
- package/dist/cli/lib/reservedExportKeys.js +12 -1
- package/dist/cli/lib/reservedExportKeys.js.map +1 -0
- package/dist/cli/lib/reservedExportKeys.unitTest.d.ts +2 -0
- package/dist/cli/lib/reservedExportKeys.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/reservedExportKeys.unitTest.js +6 -8
- package/dist/cli/lib/reservedExportKeys.unitTest.js.map +1 -0
- package/dist/cli/lib/runDescribe.d.ts.map +1 -1
- package/dist/cli/lib/runDescribe.js +39 -39
- package/dist/cli/lib/runDescribe.js.map +1 -1
- package/dist/cli/lib/runDescribe.unitTest.d.ts +2 -0
- package/dist/cli/lib/runDescribe.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/runDescribe.unitTest.js +22 -402
- package/dist/cli/lib/runDescribe.unitTest.js.map +1 -0
- package/dist/cli/lib/runDescribeRun.js +34 -49
- package/dist/cli/lib/runDescribeRun.js.map +1 -1
- package/dist/cli/lib/runDescribeRun.unitTest.d.ts +2 -0
- package/dist/cli/lib/runDescribeRun.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/runDescribeRun.unitTest.js +44 -410
- package/dist/cli/lib/runDescribeRun.unitTest.js.map +1 -0
- package/dist/cli/lib/runIt.d.ts +1 -1
- package/dist/cli/lib/runIt.d.ts.map +1 -1
- package/dist/cli/lib/runIt.js +59 -69
- package/dist/cli/lib/runIt.js.map +1 -1
- package/dist/cli/lib/runIt.unitTest.d.ts +2 -0
- package/dist/cli/lib/runIt.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/runIt.unitTest.js +73 -410
- package/dist/cli/lib/runIt.unitTest.js.map +1 -0
- package/dist/cli/lib/runTasks.d.ts +1 -1
- package/dist/cli/lib/runTasks.d.ts.map +1 -1
- package/dist/cli/lib/runTasks.js +28 -31
- package/dist/cli/lib/runTasks.js.map +1 -1
- package/dist/cli/lib/runTasks.unitTest.d.ts +5 -0
- package/dist/cli/lib/runTasks.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/runTasks.unitTest.js +35 -31
- package/dist/cli/lib/runTasks.unitTest.js.map +1 -0
- package/dist/cli/lib/runTest.js +54 -66
- package/dist/cli/lib/runTest.js.map +1 -1
- package/dist/cli/lib/runTest.unitTest.d.ts +20 -0
- package/dist/cli/lib/runTest.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/runTest.unitTest.js +274 -289
- package/dist/cli/lib/runTest.unitTest.js.map +1 -0
- package/dist/cli/lib/runTests.d.ts.map +1 -1
- package/dist/cli/lib/runTests.js +123 -141
- package/dist/cli/lib/runTests.js.map +1 -1
- package/dist/cli/lib/runTests.unitTest.d.ts +6 -0
- package/dist/cli/lib/runTests.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/runTests.unitTest.js +48 -61
- package/dist/cli/lib/runTests.unitTest.js.map +1 -0
- package/dist/cli/lib/showTestLoadingError.js +22 -33
- package/dist/cli/lib/showTestLoadingError.js.map +1 -1
- package/dist/cli/lib/showTestLoadingError.unitTest.d.ts +2 -0
- package/dist/cli/lib/showTestLoadingError.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/showTestLoadingError.unitTest.js +16 -24
- package/dist/cli/lib/showTestLoadingError.unitTest.js.map +1 -0
- package/dist/cli/lib/showTestResult.js +88 -88
- package/dist/cli/lib/showTestResult.js.map +1 -1
- package/dist/cli/lib/showTestResult.unitTest.d.ts +2 -0
- package/dist/cli/lib/showTestResult.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/showTestResult.unitTest.js +176 -184
- package/dist/cli/lib/showTestResult.unitTest.js.map +1 -0
- package/dist/cli/lib/testHelpers/makeCustomOut.d.ts +7 -0
- package/dist/cli/lib/testHelpers/makeCustomOut.d.ts.map +1 -0
- package/dist/cli/lib/testHelpers/makeCustomOut.js +10 -0
- package/dist/cli/lib/testHelpers/makeCustomOut.js.map +1 -0
- package/dist/cli/lib/timeProfier.js +4 -6
- package/dist/cli/lib/timeProfier.js.map +1 -1
- package/dist/cli/lib/validateConfig.js +21 -24
- package/dist/cli/lib/validateConfig.unitTest.d.ts +2 -0
- package/dist/cli/lib/validateConfig.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/validateConfig.unitTest.js +17 -18
- package/dist/cli/lib/validateConfig.unitTest.js.map +1 -0
- package/dist/cli/lib/{watchFiles.js → watchFiles.d.ts} +2 -1
- package/dist/cli/lib/watchFiles.d.ts.map +1 -0
- package/dist/cli/lib/watchFiles.js.map +1 -0
- package/dist/cli/lib/watchFiles.unitTest.d.ts +2 -0
- package/dist/cli/lib/watchFiles.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/watchFiles.unitTest.js.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTests.js +2 -3
- package/dist/cli/lib/watchFilesAndRunTests.unitTest.d.ts +2 -0
- package/dist/cli/lib/watchFilesAndRunTests.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTests.unitTest.js +86 -96
- package/dist/cli/lib/watchFilesAndRunTests.unitTest.js.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.d.ts.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js +99 -127
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.d.ts +2 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.js +90 -99
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.unitTest.js.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +108 -148
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js.map +1 -1
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.d.ts +2 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.js +87 -100
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.unitTest.js.map +1 -0
- package/dist/cli/lib/watchFilesChokidar.js +30 -56
- package/dist/cli/lib/watchFilesChokidar.js.map +1 -1
- package/dist/cli/lib/watchFilesChokidar.unitTest.d.ts +2 -0
- package/dist/cli/lib/watchFilesChokidar.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesChokidar.unitTest.js +77 -81
- package/dist/cli/lib/watchFilesChokidar.unitTest.js.map +1 -0
- package/dist/cli/lib/watchFilesNodeWatch.js +31 -41
- package/dist/cli/lib/watchFilesNodeWatch.js.map +1 -1
- package/dist/cli/lib/watchFilesNodeWatch.unitTest.d.ts +2 -0
- package/dist/cli/lib/watchFilesNodeWatch.unitTest.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesNodeWatch.unitTest.js +41 -46
- package/dist/cli/lib/watchFilesNodeWatch.unitTest.js.map +1 -0
- package/dist/cli/once.js +35 -42
- package/dist/cli/once.js.map +1 -1
- package/dist/cli/watch.js +64 -114
- package/dist/cli/watch.js.map +1 -1
- package/dist/cli/watch.unitTest.d.ts +6 -0
- package/dist/cli/watch.unitTest.d.ts.map +1 -0
- package/dist/cli/watch.unitTest.js +100 -111
- package/dist/cli/watch.unitTest.js.map +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -2
- package/dist/config.js.map +1 -1
- package/dist/describe.js +20 -34
- package/dist/describe.js.map +1 -1
- package/dist/describe.unitTest.d.ts +2 -0
- package/dist/describe.unitTest.d.ts.map +1 -0
- package/dist/describe.unitTest.js +19 -23
- package/dist/describe.unitTest.js.map +1 -0
- package/dist/index.js +2 -1
- package/dist/indexNumberToLetters.js +12 -11
- package/dist/output.js +16 -18
- package/dist/packages/chalk.d.ts +14 -0
- package/dist/packages/chalk.d.ts.map +1 -0
- package/dist/packages/chalk.js +22 -0
- package/dist/packages/chalk.js.map +1 -0
- package/dist/packages/figures.d.ts +6 -0
- package/dist/packages/figures.d.ts.map +1 -0
- package/dist/packages/figures.js +24 -0
- package/dist/packages/figures.js.map +1 -0
- package/dist/packages/loadConfig.d.ts +3 -0
- package/dist/packages/loadConfig.d.ts.map +1 -0
- package/dist/packages/loadConfig.js +28 -0
- package/dist/packages/loadConfig.js.map +1 -0
- package/dist/packages/mergeStructuredConfig.d.ts +2 -0
- package/dist/packages/mergeStructuredConfig.d.ts.map +1 -0
- package/dist/packages/mergeStructuredConfig.js +26 -0
- package/dist/packages/mergeStructuredConfig.js.map +1 -0
- package/dist/packages/slash.d.ts +2 -0
- package/dist/packages/slash.d.ts.map +1 -0
- package/dist/packages/slash.js +9 -0
- package/dist/packages/slash.js.map +1 -0
- package/dist/packages/timeProfiler.d.ts +6 -0
- package/dist/packages/timeProfiler.d.ts.map +1 -0
- package/dist/packages/timeProfiler.js +32 -0
- package/dist/packages/timeProfiler.js.map +1 -0
- package/dist/types.d.ts +13 -13
- package/dist/types.d.ts.map +1 -1
- package/package.json +24 -20
- package/dist/cli/files.js +0 -20
- package/dist/cli/files.unitTest.js +0 -246
- package/dist/cli/init.unitTest.js +0 -0
- package/dist/cli/lib/defaultConfig.test.js +0 -9
- package/dist/cli/lib/loadTestFileStatic.js +0 -41
- package/dist/cli/lib/loadTestFileStatic.unitTest.js +0 -30
- package/dist/cli/lib/processWatchEvent.js +0 -1
- package/dist/cli/lib/processWatchEvent.unitTest.js +0 -15
- package/dist/cli/lib/runDescribe.old.js +0 -108
- package/dist/cli/lib/runDescribe.old.unitTest.js +0 -440
- package/dist/cli/lib/runTest-old.js +0 -160
- package/dist/cli/lib/runTest-old.unitTest.js +0 -184
- package/dist/cli/lib/watchFiles.unitTest.js +0 -50
- package/dist/cli/once.unitTest.js +0 -39
- package/dist/describe-old.js +0 -271
- package/dist/describe-old.unitTest.js +0 -30
- package/dist/exported.eslintrc.js +0 -7
- package/dist/lib/arrayRemove.d.ts +0 -2
- package/dist/lib/arrayRemove.d.ts.map +0 -1
- package/dist/lib/arrayRemove.js +0 -15
- package/dist/lib/arrayRemove.js.map +0 -1
- package/dist/lib/promiseAllObj.d.ts +0 -2
- package/dist/lib/promiseAllObj.d.ts.map +0 -1
- package/dist/lib/promiseAllObj.js +0 -14
- package/dist/lib/promiseAllObj.js.map +0 -1
- package/dist/testsState.js +0 -5
- package/dist/timeProfiling.js +0 -9
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import chalk from 'chalk-extensions';
|
|
4
|
-
import { globby } from 'globby';
|
|
5
|
-
import { out, log, debug } from '../../output.js';
|
|
6
|
-
const {
|
|
7
|
-
timeProfileAsync
|
|
8
|
-
} = await createTimeProfiler(showTimeProfiling);
|
|
1
|
+
import { glob } from 'fs/promises';
|
|
2
|
+
import slash from '../../packages/slash.js';
|
|
9
3
|
import { addBasePath } from './addBasePath.js';
|
|
10
4
|
export async function findTestFiles(config) {
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
}
|
|
5
|
+
const testsGlobs = addBasePath(config.testsBase, config.tests);
|
|
6
|
+
const testsIgnoreGlobs = addBasePath(config.testsBase, config.testsIgnore);
|
|
7
|
+
// Node's built-in glob replaces the globby/tinyglobby dependency (no import cost).
|
|
8
|
+
// It yields OS-native separators, so slash() restores the forward-slash paths the
|
|
9
|
+
// rest of the runner relies on (watch-mode minimatch filters, dependency-tree keys).
|
|
10
|
+
const files = [];
|
|
11
|
+
for await (const file of glob(testsGlobs, {
|
|
12
|
+
exclude: Array.isArray(testsIgnoreGlobs) ? testsIgnoreGlobs : [testsIgnoreGlobs]
|
|
13
|
+
})) {
|
|
14
|
+
files.push(slash(file));
|
|
15
|
+
}
|
|
16
|
+
return files;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=findTestFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findTestFiles.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"findTestFiles.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAG3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAC9C,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IAC9D,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IAE1E,mFAAmF;IACnF,kFAAkF;IAClF,qFAAqF;IACrF,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;QACtC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;KACnF,CAAC,EAAE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3B,CAAC;IAED,OAAO,KAAK,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findTestFiles.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.unitTest.ts"],"names":[],"mappings":""}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { applyConfigDefaults } from './applyConfigDefaults.js';
|
|
2
2
|
import { findTestFiles } from './findTestFiles.js';
|
|
3
|
-
|
|
4
3
|
// findTestFiles(config)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
mochaDescribe('findTestFiles() function', function () {
|
|
5
|
+
mochaIt('finds the tests files', async function () {
|
|
6
|
+
// get the default configs
|
|
7
|
+
const config = applyConfigDefaults({ tests: 'unitTesting/**/*.test.js' });
|
|
8
|
+
const testFiles = await findTestFiles(config);
|
|
9
|
+
testFiles.should.include.members([
|
|
10
|
+
'unitTesting/sampleTests/1.test.js',
|
|
11
|
+
'unitTesting/sampleTests/2.test.js'
|
|
12
|
+
]);
|
|
11
13
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
mochaIt('respects tests base config entry', async function () {
|
|
15
|
+
// get the default configs
|
|
16
|
+
const config = applyConfigDefaults({
|
|
17
|
+
testsBase: 'src',
|
|
18
|
+
tests: 'unitTesting/**/*.test.js'
|
|
19
|
+
});
|
|
20
|
+
const testFiles = await findTestFiles(config);
|
|
21
|
+
testFiles.length.should.equal(0);
|
|
20
22
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=findTestFiles.unitTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findTestFiles.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/findTestFiles.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,wBAAwB;AAExB,aAAa,CAAC,0BAA0B,EAAE;IACtC,OAAO,CAAC,uBAAuB,EAAE,KAAK;QAClC,0BAA0B;QAC1B,MAAM,MAAM,GAAG,mBAAmB,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAA;QAEzE,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,CAAA;QAE7C,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAC7B,mCAAmC;YACnC,mCAAmC;SACtC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,kCAAkC,EAAE,KAAK;QAC7C,0BAA0B;QAC1B,MAAM,MAAM,GAAG,mBAAmB,CAAC;YAC/B,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,0BAA0B;SACpC,CAAC,CAAA;QAEF,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,CAAA;QAE7C,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export function getAllowedFlags(allowedArguments) {
|
|
2
|
+
const allowedFlags = {};
|
|
3
|
+
for (const option in allowedArguments) {
|
|
4
|
+
const argument = allowedArguments[option];
|
|
5
|
+
if (argument && 'flag' in argument) {
|
|
6
|
+
allowedFlags[argument.flag] = option;
|
|
7
|
+
}
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
return allowedFlags;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=getAllowedFlags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllowedFlags.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/getAllowedFlags.unitTest.ts"],"names":[],"mappings":""}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { getAllowedFlags } from './getAllowedFlags.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
2
|
+
mochaDescribe('getAllowedFlags() function', function () {
|
|
3
|
+
mochaIt('extracts the flags from an allowedArguments object', function () {
|
|
4
|
+
const allowedArguments = {
|
|
5
|
+
config: {
|
|
6
|
+
flag: 'c',
|
|
7
|
+
hasValue: true
|
|
8
|
+
},
|
|
9
|
+
watch: {
|
|
10
|
+
flag: 'w',
|
|
11
|
+
hasValue: false
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const allowedFlags = getAllowedFlags(allowedArguments);
|
|
15
|
+
allowedFlags.should.have.keys([
|
|
16
|
+
'c',
|
|
17
|
+
'w'
|
|
18
|
+
]);
|
|
19
|
+
allowedFlags.c?.should.equal('config');
|
|
20
|
+
allowedFlags.w?.should.equal('watch');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=getAllowedFlags.unitTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllowedFlags.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/getAllowedFlags.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGtD,aAAa,CAAC,4BAA4B,EAAE;IACxC,OAAO,CAAC,oDAAoD,EAAE;QAC1D,MAAM,gBAAgB,GAAqB;YACvC,MAAM,EAAE;gBACJ,IAAI,EAAE,GAAG;gBACT,QAAQ,EAAE,IAAI;aACjB;YACD,KAAK,EAAE;gBACH,IAAI,EAAE,GAAG;gBACT,QAAQ,EAAE,KAAK;aAClB;SACJ,CAAA;QAED,MAAM,YAAY,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAA;QAEtD,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YAC1B,GAAG;YACH,GAAG;SACN,CAAC,CAAA;QAEF,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACtC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function globArgCombine(patterns) {
|
|
2
|
+
if (!Array.isArray(patterns))
|
|
3
|
+
return patterns;
|
|
4
|
+
return (patterns.length > 1)
|
|
5
|
+
? '{' + patterns.join(',') + '}'
|
|
6
|
+
: (patterns[0] ?? '');
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=globArgCombine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globArgCombine.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/globArgCombine.unitTest.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { globArgCombine } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
1
|
+
import { globArgCombine } from './globArgCombine.js';
|
|
2
|
+
mochaDescribe('globArgCombine() function', function () {
|
|
3
|
+
mochaIt('leaves strings alone', function () {
|
|
4
|
+
const testString = '*.test.js';
|
|
5
|
+
const result = globArgCombine(testString);
|
|
6
|
+
result.should.equal(testString);
|
|
7
|
+
});
|
|
8
|
+
mochaIt('extracts the item from a single item array', function () {
|
|
9
|
+
const testStringsArray = ['*.test.js'];
|
|
10
|
+
const result = globArgCombine(testStringsArray);
|
|
11
|
+
result.should.equal(testStringsArray[0]);
|
|
12
|
+
});
|
|
13
|
+
mochaIt('combined an array into a multi option glob e.g. {a,b}', function () {
|
|
14
|
+
const testStringsArray = ['*.test.js', '*.spec.js'];
|
|
15
|
+
const result = globArgCombine(testStringsArray);
|
|
16
|
+
result.should.equal(`{${testStringsArray[0]},${testStringsArray[1]}}`);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=globArgCombine.unitTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globArgCombine.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/globArgCombine.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,aAAa,CAAC,2BAA2B,EAAE;IACvC,OAAO,CAAC,sBAAsB,EAAE;QAC5B,MAAM,UAAU,GAAG,WAAW,CAAA;QAE9B,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;QAEzC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,4CAA4C,EAAE;QAClD,MAAM,gBAAgB,GAAG,CAAC,WAAW,CAAC,CAAA;QAEtC,MAAM,MAAM,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;QAE/C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,uDAAuD,EAAE;QAC7D,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;QAEnD,MAAM,MAAM,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;QAE/C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectProperties.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"injectProperties.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAExD,wBAAgB,gBAAgB,CAC5B,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,GACrF,IAAI,CAQN"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { out as mainOut
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { out as mainOut } from '../../output.js';
|
|
2
|
+
import { reservedExportKeys } from './reservedExportKeys.js';
|
|
3
|
+
export function injectProperties(basePackage, injectProperties, from, customOut) {
|
|
4
|
+
const out = customOut ?? mainOut;
|
|
5
|
+
for (const key in injectProperties) {
|
|
6
|
+
if (reservedExportKeys.includes(key)) {
|
|
7
|
+
out(`Error: key '${key}' is reserved. Please do not use this key. From '${from}'.`);
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=injectProperties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectProperties.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"injectProperties.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG5D,MAAM,UAAU,gBAAgB,CAC5B,WAAoB,EAAE,gBAA6B,EAAE,IAAY,EAAE,SAAiB;IAEpF,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAA;IAEhC,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACjC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,GAAG,CAAC,eAAe,GAAG,oDAAoD,IAAI,IAAI,CAAC,CAAA;QACvF,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injectProperties.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.unitTest.ts"],"names":[],"mappings":""}
|
|
@@ -1,81 +1,19 @@
|
|
|
1
|
-
import { injectProperties } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
await outBuffer.should.include(errorString);
|
|
21
|
-
outBuffer = '';
|
|
22
|
-
properties = {
|
|
23
|
-
it: true
|
|
24
|
-
};
|
|
25
|
-
await injectProperties(basePacket, properties, '', customOut);
|
|
26
|
-
await outBuffer.should.include(errorString);
|
|
27
|
-
outBuffer = '';
|
|
28
|
-
properties = {
|
|
29
|
-
test: true
|
|
30
|
-
};
|
|
31
|
-
await injectProperties(basePacket, properties, '', customOut);
|
|
32
|
-
await outBuffer.should.include(errorString);
|
|
33
|
-
outBuffer = '';
|
|
34
|
-
properties = {
|
|
35
|
-
before: true
|
|
36
|
-
};
|
|
37
|
-
await injectProperties(basePacket, properties, '', customOut);
|
|
38
|
-
await outBuffer.should.include(errorString);
|
|
39
|
-
outBuffer = '';
|
|
40
|
-
properties = {
|
|
41
|
-
after: true
|
|
42
|
-
};
|
|
43
|
-
await injectProperties(basePacket, properties, '', customOut);
|
|
44
|
-
await outBuffer.should.include(errorString);
|
|
45
|
-
outBuffer = '';
|
|
46
|
-
properties = {
|
|
47
|
-
beforeEach: true
|
|
48
|
-
};
|
|
49
|
-
await injectProperties(basePacket, properties, '', customOut);
|
|
50
|
-
await outBuffer.should.include(errorString);
|
|
51
|
-
outBuffer = '';
|
|
52
|
-
properties = {
|
|
53
|
-
afterEach: true
|
|
54
|
-
};
|
|
55
|
-
await injectProperties(basePacket, properties, '', customOut);
|
|
56
|
-
await outBuffer.should.include(errorString);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// mochaIt('complains if a passed property conflics with a base property', function() {
|
|
60
|
-
|
|
61
|
-
// let outBuffer = ''
|
|
62
|
-
// const customOut = sync((...texts) => {
|
|
63
|
-
// console.log(...texts)
|
|
64
|
-
// outBuffer += texts.join(' ') + '\n' // join and save to the buffer
|
|
65
|
-
// })
|
|
66
|
-
|
|
67
|
-
// const errorString = 'is reserved'
|
|
68
|
-
|
|
69
|
-
// const basePacket = {}
|
|
70
|
-
|
|
71
|
-
// let properties
|
|
72
|
-
|
|
73
|
-
// outBuffer = ''
|
|
74
|
-
// properties = {
|
|
75
|
-
// describe: true
|
|
76
|
-
// }
|
|
77
|
-
// injectProperties(basePacket, properties, '', customOut)
|
|
78
|
-
// outBuffer.should.include(errorString)
|
|
79
|
-
|
|
80
|
-
// })
|
|
81
|
-
});
|
|
1
|
+
import { injectProperties } from './injectProperties.js';
|
|
2
|
+
mochaDescribe('injectProperties() function', function () {
|
|
3
|
+
mochaIt('complains if a reserved property is given', function () {
|
|
4
|
+
let outBuffer = '';
|
|
5
|
+
const customOut = (...texts) => {
|
|
6
|
+
console.log(...texts); // eslint-disable-line no-console
|
|
7
|
+
outBuffer += texts.join(' ') + '\n'; // join and save to the buffer
|
|
8
|
+
};
|
|
9
|
+
const errorString = 'is reserved';
|
|
10
|
+
const basePacket = {};
|
|
11
|
+
const reservedKeys = ['describe', 'it', 'test', 'before', 'after', 'beforeEach', 'afterEach'];
|
|
12
|
+
for (const key of reservedKeys) {
|
|
13
|
+
outBuffer = '';
|
|
14
|
+
injectProperties(basePacket, { [key]: true }, '', customOut);
|
|
15
|
+
outBuffer.should.include(errorString);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=injectProperties.unitTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injectProperties.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/injectProperties.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,aAAa,CAAC,6BAA6B,EAAE;IACzC,OAAO,CAAC,2CAA2C,EAAE;QACjD,IAAI,SAAS,GAAG,EAAE,CAAA;QAClB,MAAM,SAAS,GAAG,CAAC,GAAG,KAAgB,EAAQ,EAAE;YAC5C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA,CAAC,iCAAiC;YACvD,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA,CAAC,8BAA8B;QACtE,CAAC,CAAA;QAED,MAAM,WAAW,GAAG,aAAa,CAAA;QACjC,MAAM,UAAU,GAAG,EAAE,CAAA;QACrB,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;QAE7F,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;YAC7B,SAAS,GAAG,EAAE,CAAA;YACd,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;YAC5D,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QACzC,CAAC;IACL,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { loadConfig as sxyLoadConfig, loadConfigExact as sxyLoadConfigExact
|
|
2
|
-
import { packageName, cliName, configFileName, configLocations
|
|
3
|
-
import chalk from 'chalk
|
|
4
|
-
import { out
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return await timeProfileAsync('load config', async () => {
|
|
10
|
-
const configOrNull = customLocation !== undefined ? await sxyLoadConfigExact(customLocation) : await sxyLoadConfig(configFileName, configLocations);
|
|
11
|
-
await debug('configOrNull', typeof configOrNull, configOrNull);
|
|
1
|
+
import { loadConfig as sxyLoadConfig, loadConfigExact as sxyLoadConfigExact } from '../../packages/loadConfig.js';
|
|
2
|
+
import { packageName, cliName, configFileName, configLocations } from '../../config.js';
|
|
3
|
+
import chalk from '../../packages/chalk.js';
|
|
4
|
+
import { out } from '../../output.js';
|
|
5
|
+
export async function loadConfig(customLocation) {
|
|
6
|
+
const configOrNull = (customLocation !== undefined)
|
|
7
|
+
? await sxyLoadConfigExact(customLocation)
|
|
8
|
+
: await sxyLoadConfig(configFileName, configLocations);
|
|
12
9
|
if (!configOrNull) {
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
out(chalk.orange(`[${packageName}] No config found.`
|
|
11
|
+
+ `\nPlease create a ${configFileName}.js/cjs/mjs file in your project root or /config folder.`
|
|
12
|
+
+ `\nOr run \`npx ${cliName} init\` to create one.`));
|
|
13
|
+
process.exit(0);
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
//log('user config', configOrNull)
|
|
18
|
-
|
|
19
15
|
return configOrNull;
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=loadConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"loadConfig.js","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,KAAK,MAAM,yBAAyB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAGrC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,cAAuB;IACpD,MAAM,YAAY,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC;QAC/C,CAAC,CAAC,MAAM,kBAAkB,CAAa,cAAc,CAAC;QACtD,CAAC,CAAC,MAAM,aAAa,CAAa,cAAc,EAAE,eAAe,CAAC,CAAA;IAEtE,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,WAAW,oBAAoB;cAC9C,qBAAqB,cAAc,0DAA0D;cAC7F,kBAAkB,OAAO,wBAAwB,CAAC,CAAC,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC;IAED,OAAO,YAAY,CAAA;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadConfig.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.unitTest.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { loadConfig } from
|
|
2
|
-
|
|
1
|
+
import { loadConfig } from './loadConfig.js';
|
|
3
2
|
// loadConfig(location)
|
|
4
|
-
// location is
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
3
|
+
// location is optional
|
|
4
|
+
mochaDescribe('loadConfig() function', function () {
|
|
5
|
+
mochaIt('loads a user config', async function () {
|
|
6
|
+
const userConfig = await loadConfig();
|
|
7
|
+
userConfig.should.not.be.null;
|
|
8
|
+
});
|
|
9
|
+
mochaIt('loads a user config from a location passed to it', async function () {
|
|
10
|
+
const configLocation = 'unitTesting/sampleConfig/sxy-test-runner.config.js';
|
|
11
|
+
const userConfig = await loadConfig(configLocation);
|
|
12
|
+
userConfig.should.not.be.null;
|
|
13
|
+
userConfig.tests?.should.equal('alt-config-location');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=loadConfig.unitTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadConfig.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/loadConfig.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,uBAAuB;AACvB,uBAAuB;AACvB,aAAa,CAAC,uBAAuB,EAAE;IACnC,OAAO,CAAC,qBAAqB,EAAE,KAAK;QAChC,MAAM,UAAU,GAAG,MAAM,UAAU,EAAE,CAAA;QAErC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAA;IACjC,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,kDAAkD,EAAE,KAAK;QAC7D,MAAM,cAAc,GAAG,oDAAoD,CAAA;QAC3E,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,CAAA;QAEnD,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAA;QAC7B,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|