sxy-test-runner 1.4.5 → 2.0.1
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.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +24 -22
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +41 -91
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/lib/addBasePath.d.ts +3 -0
- package/dist/cli/lib/addBasePath.d.ts.map +1 -0
- package/dist/cli/lib/addBasePath.js +12 -14
- package/dist/cli/lib/addBasePath.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/addExports.d.ts.map +1 -0
- package/dist/cli/lib/addExports.js +13 -11
- package/dist/cli/lib/addExports.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/applyConfigDefaults.d.ts.map +1 -0
- package/dist/cli/lib/applyConfigDefaults.js +6 -42
- package/dist/cli/lib/applyConfigDefaults.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/buildDependencyTree.d.ts.map +1 -0
- package/dist/cli/lib/buildDependencyTree.js +23 -34
- package/dist/cli/lib/buildDependencyTree.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/buildDependencyTrees.d.ts.map +1 -0
- package/dist/cli/lib/buildDependencyTrees.js +15 -34
- package/dist/cli/lib/buildDependencyTrees.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/defaultConfig.d.ts.map +1 -0
- package/dist/cli/lib/defaultConfig.js +23 -21
- package/dist/cli/lib/defaultConfig.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/doUserSetup.d.ts.map +1 -0
- package/dist/cli/lib/doUserSetup.js +20 -23
- package/dist/cli/lib/doUserSetup.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/doUserTeardown.d.ts.map +1 -0
- package/dist/cli/lib/doUserTeardown.js +21 -23
- package/dist/cli/lib/doUserTeardown.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/findTestFiles.d.ts.map +1 -0
- package/dist/cli/lib/findTestFiles.js +16 -24
- package/dist/cli/lib/findTestFiles.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/getAllowedFlags.d.ts.map +1 -0
- package/dist/cli/lib/getAllowedFlags.js +10 -8
- package/dist/cli/lib/getAllowedFlags.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/globArgCombine.d.ts.map +1 -0
- package/dist/cli/lib/globArgCombine.js +8 -1
- package/dist/cli/lib/globArgCombine.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/injectProperties.d.ts.map +1 -0
- package/dist/cli/lib/injectProperties.js +10 -10
- package/dist/cli/lib/injectProperties.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/loadConfig.d.ts.map +1 -0
- package/dist/cli/lib/loadConfig.js +14 -18
- package/dist/cli/lib/loadConfig.js.map +1 -0
- 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.d.ts +4 -0
- package/dist/cli/lib/loadTestFile.d.ts.map +1 -0
- package/dist/cli/lib/loadTestFile.js +48 -78
- package/dist/cli/lib/loadTestFile.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/parseCommandLineArguments.d.ts.map +1 -0
- package/dist/cli/lib/parseCommandLineArguments.js +48 -42
- package/dist/cli/lib/parseCommandLineArguments.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/parseDescribe.d.ts.map +1 -0
- package/dist/cli/lib/parseDescribe.js +67 -81
- package/dist/cli/lib/parseDescribe.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/runDescribe.d.ts.map +1 -0
- package/dist/cli/lib/runDescribe.js +39 -39
- package/dist/cli/lib/runDescribe.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/runDescribeRun.d.ts.map +1 -0
- package/dist/cli/lib/runDescribeRun.js +34 -49
- package/dist/cli/lib/runDescribeRun.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/runIt.d.ts.map +1 -0
- package/dist/cli/lib/runIt.js +59 -69
- package/dist/cli/lib/runIt.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/runTasks.d.ts.map +1 -0
- package/dist/cli/lib/runTasks.js +28 -31
- package/dist/cli/lib/runTasks.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/runTest.d.ts.map +1 -0
- package/dist/cli/lib/runTest.js +54 -66
- package/dist/cli/lib/runTest.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/runTests.d.ts.map +1 -0
- package/dist/cli/lib/runTests.js +123 -141
- package/dist/cli/lib/runTests.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/showTestLoadingError.d.ts.map +1 -0
- package/dist/cli/lib/showTestLoadingError.js +22 -33
- package/dist/cli/lib/showTestLoadingError.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/showTestResult.d.ts.map +1 -0
- package/dist/cli/lib/showTestResult.js +88 -88
- package/dist/cli/lib/showTestResult.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/cli/lib/timeProfier.d.ts.map +1 -0
- package/dist/cli/lib/timeProfier.js +4 -6
- package/dist/cli/lib/timeProfier.js.map +1 -0
- package/dist/cli/lib/validateConfig.d.ts +3 -0
- package/dist/cli/lib/validateConfig.d.ts.map +1 -0
- package/dist/cli/lib/validateConfig.js +21 -24
- package/dist/cli/lib/validateConfig.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/cli/lib/watchFilesAndRunTests.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTests.js +2 -3
- package/dist/cli/lib/watchFilesAndRunTests.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js +99 -127
- package/dist/cli/lib/watchFilesAndRunTestsChokidar.js.map +1 -0
- 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 +3 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js +108 -148
- package/dist/cli/lib/watchFilesAndRunTestsNodeWatch.js.map +1 -0
- 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.d.ts +4 -0
- package/dist/cli/lib/watchFilesChokidar.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesChokidar.js +30 -56
- package/dist/cli/lib/watchFilesChokidar.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/cli/lib/watchFilesNodeWatch.d.ts.map +1 -0
- package/dist/cli/lib/watchFilesNodeWatch.js +31 -41
- package/dist/cli/lib/watchFilesNodeWatch.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/cli/once.d.ts.map +1 -0
- package/dist/cli/once.js +59 -42
- package/dist/cli/once.js.map +1 -0
- package/dist/cli/once.unitTest.d.ts +2 -0
- package/dist/cli/once.unitTest.d.ts.map +1 -0
- package/dist/cli/once.unitTest.js +74 -39
- package/dist/cli/once.unitTest.js.map +1 -0
- package/dist/cli/watch.d.ts +2 -0
- package/dist/cli/watch.d.ts.map +1 -0
- package/dist/cli/watch.js +64 -114
- package/dist/cli/watch.js.map +1 -0
- 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 +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +13 -2
- package/dist/config.js.map +1 -0
- package/dist/describe.d.ts +3 -0
- package/dist/describe.d.ts.map +1 -0
- package/dist/describe.js +20 -34
- package/dist/describe.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/dist/indexNumberToLetters.d.ts +2 -0
- package/dist/indexNumberToLetters.d.ts.map +1 -0
- package/dist/indexNumberToLetters.js +12 -11
- package/dist/indexNumberToLetters.js.map +1 -0
- package/dist/output.d.ts +6 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +16 -18
- package/dist/output.js.map +1 -0
- 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 +138 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +25 -22
- 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/describe-old.js +0 -271
- package/dist/describe-old.unitTest.js +0 -30
- package/dist/exported.eslintrc.js +0 -7
- package/dist/testsState.js +0 -5
- package/dist/timeProfiling.js +0 -9
|
@@ -1,55 +1,40 @@
|
|
|
1
1
|
import { timeProfileAsync } from './timeProfier.js';
|
|
2
2
|
import { runTasks } from './runTasks.js';
|
|
3
|
-
import { addExports } from './addExports.js';
|
|
4
3
|
import { debug } from '../../output.js';
|
|
5
4
|
import { runIt } from './runIt.js';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
itResults,
|
|
36
|
-
itResultsSummary
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// run after
|
|
40
|
-
if (typeof afterDescribeFunc === 'function') await afterDescribeFunc();
|
|
41
|
-
await configAfterEachDescribe(config, beforeDescribeExports);
|
|
42
|
-
return describeResult;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
async function configBeforeEachDescribe(config, exports) {
|
|
46
|
-
if (config.beforeEachDescribe) {
|
|
47
|
-
const theExports = await runTasks(config.beforeEachDescribe, undefined);
|
|
48
|
-
await addExports(exports, theExports);
|
|
49
|
-
}
|
|
5
|
+
export function runDescribeRun(config, describe, parsedIts) {
|
|
6
|
+
return timeProfileAsync(`run describe, run its ${describe.thing}`, async () => {
|
|
7
|
+
const { its, beforeDescribeExports, afterDescribeFunc, beforeEachTestFunc, afterEachTestFunc } = parsedIts;
|
|
8
|
+
const itResults = [];
|
|
9
|
+
for (const it of its) {
|
|
10
|
+
itResults.push(await runIt(config, it, beforeEachTestFunc, afterEachTestFunc));
|
|
11
|
+
}
|
|
12
|
+
const itResultsSummary = {
|
|
13
|
+
total: 0,
|
|
14
|
+
passes: 0
|
|
15
|
+
};
|
|
16
|
+
for (const itResult of itResults) {
|
|
17
|
+
itResultsSummary.total += +(itResult.success !== null);
|
|
18
|
+
itResultsSummary.passes += +(itResult.success ?? false);
|
|
19
|
+
}
|
|
20
|
+
debug('itResultsSummary', itResultsSummary);
|
|
21
|
+
const describeResult = {
|
|
22
|
+
counter: describe.counter,
|
|
23
|
+
thing: describe.thing,
|
|
24
|
+
success: (itResultsSummary.total > 0) ? itResultsSummary.passes === itResultsSummary.total : null,
|
|
25
|
+
itResults,
|
|
26
|
+
itResultsSummary
|
|
27
|
+
};
|
|
28
|
+
// run after
|
|
29
|
+
if (typeof afterDescribeFunc === 'function')
|
|
30
|
+
await afterDescribeFunc();
|
|
31
|
+
await configAfterEachDescribe(config, beforeDescribeExports);
|
|
32
|
+
return describeResult;
|
|
33
|
+
});
|
|
50
34
|
}
|
|
51
35
|
async function configAfterEachDescribe(config, exports) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
36
|
+
if (config.afterEachDescribe !== undefined) {
|
|
37
|
+
await runTasks(config.afterEachDescribe, exports);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=runDescribeRun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runDescribeRun.js","sourceRoot":"","sources":["../../../src/cli/lib/runDescribeRun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAMlC,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,QAAkB,EAAE,SAAyB;IACxF,OAAO,gBAAgB,CAAC,yBAAyB,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,EAAE,GAAG,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAA;QAE1G,MAAM,SAAS,GAAe,EAAE,CAAA;QAChC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YACnB,SAAS,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,CAAC,CAAA;QAClF,CAAC;QAED,MAAM,gBAAgB,GAAqB;YACvC,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACZ,CAAA;QAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC/B,gBAAgB,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,KAAK,IAAI,CAAC,CAAA;YACtD,gBAAgB,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,KAAK,CAAC,CAAA;QAC3D,CAAC;QAED,KAAK,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAA;QAE3C,MAAM,cAAc,GAAmB;YACnC,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,OAAO,EAAE,CAAC,gBAAgB,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,KAAK,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;YACjG,SAAS;YACT,gBAAgB;SACnB,CAAA;QAED,YAAY;QACZ,IAAI,OAAO,iBAAiB,KAAK,UAAU;YAAE,MAAM,iBAAiB,EAAE,CAAA;QACtE,MAAM,uBAAuB,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;QAE5D,OAAO,cAAc,CAAA;IACzB,CAAC,CAAC,CAAA;AACN,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,MAAc,EAAE,OAAoB;IACvE,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACzC,MAAM,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runDescribeRun.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/runDescribeRun.unitTest.ts"],"names":[],"mappings":""}
|
|
@@ -2,413 +2,47 @@ import { applyConfigDefaults } from './applyConfigDefaults.js';
|
|
|
2
2
|
import { loadTestFile } from './loadTestFile.js';
|
|
3
3
|
import { runDescribeRun } from './runDescribeRun.js';
|
|
4
4
|
import { parseDescribe } from './parseDescribe.js';
|
|
5
|
-
const defaultConfig =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// chaiExpect(testResult.success).to.be.null
|
|
51
|
-
|
|
52
|
-
// //testResult.describeResultsSummary.total.should.equal(1)
|
|
53
|
-
// //testResult.describeResultsSummary.passes.should.equal(1)
|
|
54
|
-
// //testResult.describeResultsSummary.itsTotal.should.equal(1)
|
|
55
|
-
// //testResult.describeResultsSummary.itsPasses.should.equal(1)
|
|
56
|
-
|
|
57
|
-
// })
|
|
58
|
-
|
|
59
|
-
// mochaIt('should return sensible results from a test file with describes without any its/tests', function() {
|
|
60
|
-
|
|
61
|
-
// //const config = applyConfigDefaults({})
|
|
62
|
-
|
|
63
|
-
// const sampleTestFile = 'unitTesting/sampletests/describesWithoutTests.test.js'
|
|
64
|
-
// const sampleTest = loadTestFile(defaultConfig, sampleTestFile)
|
|
65
|
-
|
|
66
|
-
// const testResult = runTest(defaultConfig, sampleTest)
|
|
67
|
-
|
|
68
|
-
// //console.log(testResult)
|
|
69
|
-
// //console.log(testResult.describeResults[0].itResults)
|
|
70
|
-
// //console.log(testResult.describeResults[0].itResultsSummary)
|
|
71
|
-
|
|
72
|
-
// testResult.should.include.keys([
|
|
73
|
-
// 'file',
|
|
74
|
-
// 'success',
|
|
75
|
-
// 'describeResults',
|
|
76
|
-
// 'describeResultsSummary'
|
|
77
|
-
// ])
|
|
78
|
-
|
|
79
|
-
// chaiExpect(testResult.success).to.be.null
|
|
80
|
-
|
|
81
|
-
// testResult.describeResultsSummary.total.should.equal(0)
|
|
82
|
-
// testResult.describeResultsSummary.passes.should.equal(0)
|
|
83
|
-
// testResult.describeResultsSummary.invalid.should.equal(2)
|
|
84
|
-
// testResult.describeResultsSummary.itsTotal.should.equal(0)
|
|
85
|
-
// testResult.describeResultsSummary.itsPasses.should.equal(0)
|
|
86
|
-
|
|
87
|
-
// })
|
|
88
|
-
|
|
89
|
-
// mochaIt("should run beforeEachFile tasks (before - can't test)", function() {
|
|
90
|
-
|
|
91
|
-
// let functionHasRun = false
|
|
92
|
-
// global.beforeEachFileFileHasRun = false
|
|
93
|
-
|
|
94
|
-
// const ourConfig = {
|
|
95
|
-
// beforeEachFile: [
|
|
96
|
-
// function() {
|
|
97
|
-
// functionHasRun = true
|
|
98
|
-
// },
|
|
99
|
-
// 'unitTesting/runTest/beforeEachFile.js'
|
|
100
|
-
// ]
|
|
101
|
-
// }
|
|
102
|
-
|
|
103
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
104
|
-
|
|
105
|
-
// runTest(config, beforeAfterTest)
|
|
106
|
-
|
|
107
|
-
// functionHasRun.should.equal(true)
|
|
108
|
-
// global.beforeEachFileFileHasRun.should.equal(true)
|
|
109
|
-
|
|
110
|
-
// })
|
|
111
|
-
|
|
112
|
-
// mochaIt("should run afterEachFile tasks (after - can't test)", function() {
|
|
113
|
-
|
|
114
|
-
// let functionHasRun = false
|
|
115
|
-
// global.afterEachFileFileHasRun = false
|
|
116
|
-
|
|
117
|
-
// const ourConfig = {
|
|
118
|
-
// afterEachFile: [
|
|
119
|
-
// function() {
|
|
120
|
-
// functionHasRun = true
|
|
121
|
-
// },
|
|
122
|
-
// 'unitTesting/runTest/afterEachFile.js'
|
|
123
|
-
// ]
|
|
124
|
-
// }
|
|
125
|
-
|
|
126
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
127
|
-
|
|
128
|
-
// runTest(config, beforeAfterTest)
|
|
129
|
-
|
|
130
|
-
// functionHasRun.should.equal(true)
|
|
131
|
-
// global.afterEachFileFileHasRun.should.equal(true)
|
|
132
|
-
|
|
133
|
-
// })
|
|
134
|
-
|
|
135
|
-
// mochaIt("should run beforeEachDescribe tasks (before - can't test) each describe block", function() {
|
|
136
|
-
|
|
137
|
-
// let functionHasRunTimes = 0
|
|
138
|
-
// global.beforeEachDescribeFileHasRun = false
|
|
139
|
-
|
|
140
|
-
// const ourConfig = {
|
|
141
|
-
// beforeEachDescribe: [
|
|
142
|
-
// function() {
|
|
143
|
-
// functionHasRunTimes++
|
|
144
|
-
// },
|
|
145
|
-
// 'unitTesting/runTest/beforeEachDescribe.js'
|
|
146
|
-
// ]
|
|
147
|
-
// }
|
|
148
|
-
|
|
149
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
150
|
-
|
|
151
|
-
// runTest(config, beforeAfterTest)
|
|
152
|
-
|
|
153
|
-
// functionHasRunTimes.should.equal(2)
|
|
154
|
-
// global.beforeEachDescribeFileHasRun.should.equal(true)
|
|
155
|
-
|
|
156
|
-
// })
|
|
157
|
-
|
|
158
|
-
// mochaIt("should run afterEachDescribe tasks (after - can't test) each describe block", function() {
|
|
159
|
-
|
|
160
|
-
// let functionHasRunTimes = 0
|
|
161
|
-
// global.afterEachDescribeFileHasRun = false
|
|
162
|
-
|
|
163
|
-
// const ourConfig = {
|
|
164
|
-
// afterEachDescribe: [
|
|
165
|
-
// function() {
|
|
166
|
-
// functionHasRunTimes++
|
|
167
|
-
// },
|
|
168
|
-
// 'unitTesting/runTest/afterEachDescribe.js'
|
|
169
|
-
// ]
|
|
170
|
-
// }
|
|
171
|
-
|
|
172
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
173
|
-
|
|
174
|
-
// runTest(config, beforeAfterTest)
|
|
175
|
-
|
|
176
|
-
// functionHasRunTimes.should.equal(2)
|
|
177
|
-
// global.afterEachDescribeFileHasRun.should.equal(true)
|
|
178
|
-
|
|
179
|
-
// })
|
|
180
|
-
|
|
181
|
-
// mochaIt("should run beforeEachTest tasks (before - can't test) each test/it block", function() {
|
|
182
|
-
|
|
183
|
-
// let functionHasRunTimes = 0
|
|
184
|
-
// global.beforeEachTestbeforeEachFileFileHasRun = false
|
|
185
|
-
|
|
186
|
-
// const ourConfig = {
|
|
187
|
-
// beforeEachTest: [
|
|
188
|
-
// function() {
|
|
189
|
-
// functionHasRunTimes++
|
|
190
|
-
// },
|
|
191
|
-
// 'unitTesting/runTest/beforeEachTest.js'
|
|
192
|
-
// ]
|
|
193
|
-
// }
|
|
194
|
-
|
|
195
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
196
|
-
|
|
197
|
-
// runTest(config, beforeAfterTest)
|
|
198
|
-
|
|
199
|
-
// functionHasRunTimes.should.equal(3)
|
|
200
|
-
// global.beforeEachTestFileHasRun.should.equal(true)
|
|
201
|
-
|
|
202
|
-
// })
|
|
203
|
-
|
|
204
|
-
// mochaIt("should run afterEachTest tasks (after - can't test) each test/it block", function() {
|
|
205
|
-
|
|
206
|
-
// let functionHasRunTimes = 0
|
|
207
|
-
// global.afterEachTestFileFileHasRun = false
|
|
208
|
-
|
|
209
|
-
// const ourConfig = {
|
|
210
|
-
// afterEachTest: [
|
|
211
|
-
// function() {
|
|
212
|
-
// functionHasRunTimes++
|
|
213
|
-
// },
|
|
214
|
-
// 'unitTesting/runTest/afterEachTest.js'
|
|
215
|
-
// ]
|
|
216
|
-
// }
|
|
217
|
-
|
|
218
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
219
|
-
|
|
220
|
-
// runTest(config, beforeAfterTest)
|
|
221
|
-
|
|
222
|
-
// functionHasRunTimes.should.equal(3)
|
|
223
|
-
// global.afterEachTestFileHasRun.should.equal(true)
|
|
224
|
-
|
|
225
|
-
// })
|
|
226
|
-
|
|
227
|
-
// // exports provision to test file
|
|
228
|
-
|
|
229
|
-
// // current beforeEachFile exports aren't provided
|
|
230
|
-
// // perhaps extend sxy-loader to allow this
|
|
231
|
-
|
|
232
|
-
// mochaIt("should pass exported/returned data from beforeEachDescribe tasks", function() {
|
|
233
|
-
|
|
234
|
-
// const testFile = 'unitTesting/runTest/beforeEachDescribe.test.js'
|
|
235
|
-
// const test = loadTestFile(defaultConfig, testFile)
|
|
236
|
-
|
|
237
|
-
// const ourConfig = {
|
|
238
|
-
// beforeEachDescribe: [
|
|
239
|
-
// function() {
|
|
240
|
-
// return { functionThing : 'foo' }
|
|
241
|
-
// },
|
|
242
|
-
// 'unitTesting/runTest/beforeEachDescribeExport.js'
|
|
243
|
-
// ]
|
|
244
|
-
// }
|
|
245
|
-
|
|
246
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
247
|
-
|
|
248
|
-
// runTest(config, test)
|
|
249
|
-
|
|
250
|
-
// global.functionThing.should.equal('foo')
|
|
251
|
-
// global.fileThing.should.equal('bar')
|
|
252
|
-
|
|
253
|
-
// })
|
|
254
|
-
|
|
255
|
-
// mochaIt("should pass exported/returned data from beforeEachTest tasks", function() {
|
|
256
|
-
|
|
257
|
-
// const testFile = 'unitTesting/runTest/beforeEachTest.test.js'
|
|
258
|
-
// const test = loadTestFile(defaultConfig, testFile)
|
|
259
|
-
|
|
260
|
-
// const ourConfig = {
|
|
261
|
-
// beforeEachTest: [
|
|
262
|
-
// function() {
|
|
263
|
-
// return { functionThing : 'foo' }
|
|
264
|
-
// },
|
|
265
|
-
// 'unitTesting/runTest/beforeEachTestExport.js'
|
|
266
|
-
// ]
|
|
267
|
-
// }
|
|
268
|
-
|
|
269
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
270
|
-
|
|
271
|
-
// runTest(config, test)
|
|
272
|
-
|
|
273
|
-
// global.functionThing.should.equal('foo')
|
|
274
|
-
// global.fileThing.should.equal('bar')
|
|
275
|
-
|
|
276
|
-
// })
|
|
277
|
-
|
|
278
|
-
// // exports pass through
|
|
279
|
-
|
|
280
|
-
// mochaIt("beforeEachFile exports are passed through to afterEachFile", function() {
|
|
281
|
-
|
|
282
|
-
// // don't try to reload test, fails due to module caching
|
|
283
|
-
// //const testFile = 'unitTesting/runTest/beforeAfter.test.js'
|
|
284
|
-
// //const test = loadTestFile(defaultConfig, testFile)
|
|
285
|
-
|
|
286
|
-
// let exports
|
|
287
|
-
|
|
288
|
-
// const ourConfig = {
|
|
289
|
-
// beforeEachFile: [
|
|
290
|
-
// function() {
|
|
291
|
-
// return { functionThing : 'foo' }
|
|
292
|
-
// },
|
|
293
|
-
// 'unitTesting/runTest/beforeEachExport.js'
|
|
294
|
-
// ],
|
|
295
|
-
// afterEachFile: [
|
|
296
|
-
// function(theExports) {
|
|
297
|
-
// theExports.should.have.keys(['functionThing', 'fileThing'])
|
|
298
|
-
// exports = theExports
|
|
299
|
-
// },
|
|
300
|
-
// ]
|
|
301
|
-
// }
|
|
302
|
-
|
|
303
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
304
|
-
|
|
305
|
-
// runTest(config, beforeAfterTest)
|
|
306
|
-
|
|
307
|
-
// exports.functionThing.should.equal('foo')
|
|
308
|
-
// exports.fileThing.should.equal('bar')
|
|
309
|
-
|
|
310
|
-
// })
|
|
311
|
-
|
|
312
|
-
// mochaIt("beforeEachDescribe exports are passed through to afterEachDescribe", function() {
|
|
313
|
-
|
|
314
|
-
// // don't try to reload test, fails due to module caching
|
|
315
|
-
// //const testFile = 'unitTesting/runTest/beforeAfter.test.js'
|
|
316
|
-
// //const test = loadTestFile(defaultConfig, testFile)
|
|
317
|
-
|
|
318
|
-
// let exports
|
|
319
|
-
|
|
320
|
-
// const ourConfig = {
|
|
321
|
-
// beforeEachDescribe: [
|
|
322
|
-
// function() {
|
|
323
|
-
// return { functionThing : 'foo' }
|
|
324
|
-
// },
|
|
325
|
-
// 'unitTesting/runTest/beforeEachExport.js'
|
|
326
|
-
// ],
|
|
327
|
-
// afterEachDescribe: [
|
|
328
|
-
// function(theExports) {
|
|
329
|
-
// exports = theExports
|
|
330
|
-
// },
|
|
331
|
-
// ]
|
|
332
|
-
// }
|
|
333
|
-
|
|
334
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
335
|
-
|
|
336
|
-
// runTest(config, beforeAfterTest)
|
|
337
|
-
|
|
338
|
-
// //console.log('exports', exports)
|
|
339
|
-
|
|
340
|
-
// exports.functionThing.should.equal('foo')
|
|
341
|
-
// exports.fileThing.should.equal('bar')
|
|
342
|
-
|
|
343
|
-
// })
|
|
344
|
-
|
|
345
|
-
// mochaIt("beforeEachTest exports are passed through to afterEachTest", function() {
|
|
346
|
-
|
|
347
|
-
// // don't try to reload test, fails due to module caching
|
|
348
|
-
// //const testFile = 'unitTesting/runTest/beforeAfter.test.js'
|
|
349
|
-
// //const test = loadTestFile(defaultConfig, testFile)
|
|
350
|
-
|
|
351
|
-
// let exports
|
|
352
|
-
|
|
353
|
-
// const ourConfig = {
|
|
354
|
-
// beforeEachTest: [
|
|
355
|
-
// function() {
|
|
356
|
-
// return { functionThing : 'foo' }
|
|
357
|
-
// },
|
|
358
|
-
// 'unitTesting/runTest/beforeEachExport.js'
|
|
359
|
-
// ],
|
|
360
|
-
// afterEachTest: [
|
|
361
|
-
// function(theExports) {
|
|
362
|
-
// exports = theExports
|
|
363
|
-
// },
|
|
364
|
-
// ]
|
|
365
|
-
// }
|
|
366
|
-
|
|
367
|
-
// const config = applyConfigDefaults(ourConfig)
|
|
368
|
-
|
|
369
|
-
// runTest(config, beforeAfterTest)
|
|
370
|
-
|
|
371
|
-
// //console.log('exports', exports)
|
|
372
|
-
|
|
373
|
-
// exports.functionThing.should.equal('foo')
|
|
374
|
-
// exports.fileThing.should.equal('bar')
|
|
375
|
-
|
|
376
|
-
// })
|
|
377
|
-
|
|
378
|
-
// mochaIt("we can run code beforeEachTest and afterEachTest from within the test file", function() {
|
|
379
|
-
|
|
380
|
-
// // don't try to reload test, fails due to module caching
|
|
381
|
-
// const testFile = 'unitTesting/runTest/internalBeforeAfterEachTest.test.js'
|
|
382
|
-
// const test = loadTestFile(defaultConfig, testFile)
|
|
383
|
-
|
|
384
|
-
// const config = applyConfigDefaults({})
|
|
385
|
-
|
|
386
|
-
// global.internalBeforeEachTestRanNTimes = 0
|
|
387
|
-
// global.internalAfterEachTestRanNTimes = 0
|
|
388
|
-
// runTest(config, test)
|
|
389
|
-
|
|
390
|
-
// global.internalBeforeAfterEachTest_test1Valid.should.equal(true)
|
|
391
|
-
// global.internalBeforeAfterEachTest_test2Valid.should.equal(true)
|
|
392
|
-
// global.internalBeforeAfterEachTest_test3Valid.should.equal(true)
|
|
393
|
-
// global.internalBeforeEachTestRanNTimes.should.equal(3)
|
|
394
|
-
// global.internalAfterEachTestRanNTimes.should.equal(3)
|
|
395
|
-
|
|
396
|
-
// })
|
|
397
|
-
|
|
398
|
-
// mochaIt("we can run code afterDescribe from within descibe in the test file", function() {
|
|
399
|
-
|
|
400
|
-
// // don't try to reload test, fails due to module caching
|
|
401
|
-
// const testFile = 'unitTesting/runTest/internalAfterDescribeTest.test.js'
|
|
402
|
-
// const test = loadTestFile(defaultConfig, testFile)
|
|
403
|
-
|
|
404
|
-
// const config = applyConfigDefaults({})
|
|
405
|
-
|
|
406
|
-
// global.internalAfterDescribeRanNTimes = 0
|
|
407
|
-
// runTest(config, test)
|
|
408
|
-
|
|
409
|
-
// //global.internalAfterDescribe_test1Valid.should.equal(true)
|
|
410
|
-
// //global.internalAfterDescribe_test2Valid.should.equal(true)
|
|
411
|
-
// global.internalAfterDescribeRanNTimes.should.equal(2)
|
|
412
|
-
|
|
413
|
-
// })
|
|
414
|
-
});
|
|
5
|
+
const defaultConfig = applyConfigDefaults({});
|
|
6
|
+
function delay(ms) {
|
|
7
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
8
|
+
}
|
|
9
|
+
mochaDescribe('runDescribeRun() function', function () {
|
|
10
|
+
mochaIt('should run an it block that was loaded from a test file', async function () {
|
|
11
|
+
const sampleTestFile = 'unitTesting/runTest/1.test.js';
|
|
12
|
+
const sampleTest = await loadTestFile(defaultConfig, sampleTestFile);
|
|
13
|
+
const sampleDescribe = sampleTest.describes?.[0];
|
|
14
|
+
if (!sampleDescribe)
|
|
15
|
+
throw new Error('expected a describe to be loaded');
|
|
16
|
+
const parsedDescribe = await parseDescribe(defaultConfig, sampleDescribe);
|
|
17
|
+
const describeResult = await runDescribeRun(defaultConfig, sampleDescribe, parsedDescribe);
|
|
18
|
+
describeResult.should.include.keys([
|
|
19
|
+
'counter',
|
|
20
|
+
'thing',
|
|
21
|
+
'success',
|
|
22
|
+
'itResults',
|
|
23
|
+
'itResultsSummary'
|
|
24
|
+
]);
|
|
25
|
+
chaiExpect(describeResult.success).to.equal(true);
|
|
26
|
+
describeResult.itResultsSummary.total.should.equal(1);
|
|
27
|
+
describeResult.itResultsSummary.passes.should.equal(1);
|
|
28
|
+
});
|
|
29
|
+
mochaIt('should await an async afterDescribeFunc before returning', async function () {
|
|
30
|
+
let afterDescribeComplete = false;
|
|
31
|
+
const describe = {
|
|
32
|
+
counter: 1,
|
|
33
|
+
thing: 'describe with async afterDescribe',
|
|
34
|
+
tests: () => { }
|
|
35
|
+
};
|
|
36
|
+
const parsedDescribe = {
|
|
37
|
+
its: [],
|
|
38
|
+
beforeDescribeExports: {},
|
|
39
|
+
afterDescribeFunc: async () => {
|
|
40
|
+
await delay(50);
|
|
41
|
+
afterDescribeComplete = true;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
await runDescribeRun(defaultConfig, describe, parsedDescribe);
|
|
45
|
+
chaiExpect(afterDescribeComplete).to.equal(true);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=runDescribeRun.unitTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runDescribeRun.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/runDescribeRun.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,MAAM,aAAa,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAA;AAE7C,SAAS,KAAK,CAAC,EAAU;IACrB,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;AAChE,CAAC;AAED,aAAa,CAAC,2BAA2B,EAAE;IACvC,OAAO,CAAC,yDAAyD,EAAE,KAAK;QACpE,MAAM,cAAc,GAAG,+BAA+B,CAAA;QACtD,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;QACpE,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAA;QAChD,IAAI,CAAC,cAAc;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;QAExE,MAAM,cAAc,GAAG,MAAM,aAAa,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;QACzE,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,CAAA;QAE1F,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;YAC/B,SAAS;YACT,OAAO;YACP,SAAS;YACT,WAAW;YACX,kBAAkB;SACrB,CAAC,CAAA;QAEF,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEjD,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACrD,cAAc,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,0DAA0D,EAAE,KAAK;QACrE,IAAI,qBAAqB,GAAG,KAAK,CAAA;QAEjC,MAAM,QAAQ,GAAa;YACvB,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,mCAAmC;YAC1C,KAAK,EAAE,GAAG,EAAE,GAAe,CAAC;SAC/B,CAAA;QAED,MAAM,cAAc,GAAmB;YACnC,GAAG,EAAE,EAAE;YACP,qBAAqB,EAAE,EAAE;YACzB,iBAAiB,EAAE,KAAK,IAAI,EAAE;gBAC1B,MAAM,KAAK,CAAC,EAAE,CAAC,CAAA;gBACf,qBAAqB,GAAG,IAAI,CAAA;YAChC,CAAC;SACJ,CAAA;QAED,MAAM,cAAc,CAAC,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAA;QAE7D,UAAU,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Config, It, ItResult, TaskExports } from '../../types.js';
|
|
2
|
+
export declare function runIt(config: Config, it: It, beforeEachTestFunc: (() => TaskExports | void | Promise<TaskExports | void>) | undefined, afterEachTestFunc: (() => void | Promise<void>) | undefined): Promise<ItResult>;
|
|
3
|
+
//# sourceMappingURL=runIt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runIt.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/runIt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAa,MAAM,gBAAgB,CAAA;AAElF,wBAAgB,KAAK,CACjB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,kBAAkB,EAAE,CAAC,MAAM,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,EACxF,iBAAiB,EAAE,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAC5D,OAAO,CAAC,QAAQ,CAAC,CAuDnB"}
|