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
package/dist/cli/lib/runIt.js
CHANGED
|
@@ -1,76 +1,66 @@
|
|
|
1
1
|
import { timeProfileAsync } from './timeProfier.js';
|
|
2
2
|
import { runTasks } from './runTasks.js';
|
|
3
3
|
import { addExports } from './addExports.js';
|
|
4
|
-
export
|
|
5
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
await configAfterEachTest(config, testExports);
|
|
54
|
-
|
|
55
|
-
//// restore previous console.log
|
|
56
|
-
if (capturingConsoleLog) {
|
|
57
|
-
console.log = previousConsoleLog; // eslint-disable-line no-console
|
|
58
|
-
}
|
|
59
|
-
////
|
|
60
|
-
|
|
61
|
-
return itResult;
|
|
62
|
-
//testResults.push(testResult)
|
|
63
|
-
//testsState.testResults.push(testResult)
|
|
64
|
-
});
|
|
4
|
+
export function runIt(config, it, beforeEachTestFunc, afterEachTestFunc) {
|
|
5
|
+
return timeProfileAsync(`run it ${it.should}`, async () => {
|
|
6
|
+
const capturingConsoleLog = config.execution.tests === 'sequential';
|
|
7
|
+
let previousConsoleLog;
|
|
8
|
+
const logs = [];
|
|
9
|
+
if (capturingConsoleLog) {
|
|
10
|
+
previousConsoleLog = console.log; // eslint-disable-line no-console
|
|
11
|
+
console.log = (...texts) => { logs.push(texts); }; // eslint-disable-line no-console
|
|
12
|
+
}
|
|
13
|
+
// run before test/it
|
|
14
|
+
const testExports = {};
|
|
15
|
+
await configBeforeEachTest(config, testExports);
|
|
16
|
+
if (typeof beforeEachTestFunc === 'function') {
|
|
17
|
+
const funcExports = await beforeEachTestFunc();
|
|
18
|
+
if (funcExports)
|
|
19
|
+
addExports(testExports, funcExports);
|
|
20
|
+
}
|
|
21
|
+
const testParcel = {};
|
|
22
|
+
addExports(testParcel, testExports);
|
|
23
|
+
//// run the it
|
|
24
|
+
let success = null;
|
|
25
|
+
let error;
|
|
26
|
+
const startTime = new Date().getTime();
|
|
27
|
+
try {
|
|
28
|
+
await it.test(testParcel);
|
|
29
|
+
success = true;
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
success = false;
|
|
33
|
+
error = e;
|
|
34
|
+
}
|
|
35
|
+
const time = new Date().getTime() - startTime;
|
|
36
|
+
const itResult = {
|
|
37
|
+
counter: it.counter,
|
|
38
|
+
should: it.should,
|
|
39
|
+
success,
|
|
40
|
+
time,
|
|
41
|
+
error,
|
|
42
|
+
logs
|
|
43
|
+
};
|
|
44
|
+
// run after test/it
|
|
45
|
+
if (typeof afterEachTestFunc === 'function')
|
|
46
|
+
await afterEachTestFunc();
|
|
47
|
+
await configAfterEachTest(config, testExports);
|
|
48
|
+
if (capturingConsoleLog && previousConsoleLog) {
|
|
49
|
+
console.log = previousConsoleLog; // eslint-disable-line no-console
|
|
50
|
+
}
|
|
51
|
+
return itResult;
|
|
52
|
+
});
|
|
65
53
|
}
|
|
66
54
|
async function configBeforeEachTest(config, exports) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
if (config.beforeEachTest !== undefined) {
|
|
56
|
+
const theExports = await runTasks(config.beforeEachTest, undefined);
|
|
57
|
+
if (theExports)
|
|
58
|
+
addExports(exports, theExports);
|
|
59
|
+
}
|
|
71
60
|
}
|
|
72
61
|
async function configAfterEachTest(config, exports) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
62
|
+
if (config.afterEachTest !== undefined) {
|
|
63
|
+
await runTasks(config.afterEachTest, exports);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=runIt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runIt.js","sourceRoot":"","sources":["../../../src/cli/lib/runIt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAI5C,MAAM,UAAU,KAAK,CACjB,MAAc,EACd,EAAM,EACN,kBAAwF,EACxF,iBAA2D;IAE3D,OAAO,gBAAgB,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,KAAK,YA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,OAAO;YACP,IAAI;YACJ,KAAK;YACL,IAAI;SACP,CAAA;QAED,oBAAoB;QACpB,IAAI,OAAO,iBAAiB,KAAK,UAAU;YAAE,MAAM,iBAAiB,EAAE,CAAA;QACtE,MAAM,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;QAE9C,IAAI,mBAAmB,IAAI,kBAAkB,EAAE,CAAC;YAC5C,OAAO,CAAC,GAAG,GAAG,kBAAkB,CAAA,CAAC,iCAAiC;QACtE,CAAC;QAED,OAAO,QAAQ,CAAA;IACnB,CAAC,CAAC,CAAA;AACN,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,MAAc,EAAE,OAAoB;IACpE,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;QACnE,IAAI,UAAU;YAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IACnD,CAAC;AACL,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,MAAc,EAAE,OAAoB;IACnE,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IACjD,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runIt.unitTest.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/runIt.unitTest.ts"],"names":[],"mappings":""}
|
|
@@ -1,414 +1,77 @@
|
|
|
1
|
-
//import { should } from 'chai'
|
|
2
1
|
import { applyConfigDefaults } from './applyConfigDefaults.js';
|
|
3
2
|
import { loadTestFile } from './loadTestFile.js';
|
|
4
3
|
import { parseDescribe } from './parseDescribe.js';
|
|
5
4
|
import { runIt } from './runIt.js';
|
|
6
|
-
const defaultConfig =
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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('runIt() 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
|
+
parsedDescribe.its.length.should.equal(1);
|
|
18
|
+
const sampleIt = parsedDescribe.its[0];
|
|
19
|
+
if (!sampleIt)
|
|
20
|
+
throw new Error('expected an it to be parsed');
|
|
21
|
+
const itResult = await runIt(defaultConfig, sampleIt, undefined, undefined);
|
|
22
|
+
// should causes errors because our obj contains a field called 'should'
|
|
23
|
+
chaiExpect(itResult).to.include.keys([
|
|
24
|
+
'counter',
|
|
25
|
+
'should',
|
|
26
|
+
'success',
|
|
27
|
+
'time',
|
|
28
|
+
'error'
|
|
29
|
+
]);
|
|
30
|
+
itResult.should.should.equal('1 should equal 1');
|
|
31
|
+
chaiExpect(itResult.success).to.equal(true);
|
|
32
|
+
chaiShould.not.exist(itResult.error);
|
|
33
|
+
});
|
|
34
|
+
mochaIt('should register a failure when an async test body rejects', async function () {
|
|
35
|
+
const asyncFailingIt = {
|
|
36
|
+
counter: 1,
|
|
37
|
+
should: 'async test that rejects',
|
|
38
|
+
test: async () => {
|
|
39
|
+
await delay(20);
|
|
40
|
+
throw new Error('async failure');
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const itResult = await runIt(defaultConfig, asyncFailingIt, undefined, undefined);
|
|
44
|
+
chaiExpect(itResult.success).to.equal(false);
|
|
45
|
+
chaiShould.exist(itResult.error);
|
|
46
|
+
});
|
|
47
|
+
mochaIt('should await beforeEachTestFunc and pass its async exports to the test', async function () {
|
|
48
|
+
let seen;
|
|
49
|
+
const beforeEachTestFunc = async () => {
|
|
50
|
+
await delay(20);
|
|
51
|
+
return { injected: 'value' };
|
|
52
|
+
};
|
|
53
|
+
const it = {
|
|
54
|
+
counter: 1,
|
|
55
|
+
should: 'receives injected export',
|
|
56
|
+
test: parcel => { seen = parcel.injected; }
|
|
57
|
+
};
|
|
58
|
+
const itResult = await runIt(defaultConfig, it, beforeEachTestFunc, undefined);
|
|
59
|
+
chaiExpect(itResult.success).to.equal(true);
|
|
60
|
+
chaiExpect(seen).to.equal('value');
|
|
61
|
+
});
|
|
62
|
+
mochaIt('should await an async afterEachTestFunc before returning', async function () {
|
|
63
|
+
let afterEachComplete = false;
|
|
64
|
+
const afterEachTestFunc = async () => {
|
|
65
|
+
await delay(50);
|
|
66
|
+
afterEachComplete = true;
|
|
67
|
+
};
|
|
68
|
+
const it = {
|
|
69
|
+
counter: 1,
|
|
70
|
+
should: 'a passing test',
|
|
71
|
+
test: () => { }
|
|
72
|
+
};
|
|
73
|
+
await runIt(defaultConfig, it, undefined, afterEachTestFunc);
|
|
74
|
+
chaiExpect(afterEachComplete).to.equal(true);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=runIt.unitTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runIt.unitTest.js","sourceRoot":"","sources":["../../../src/cli/lib/runIt.unitTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,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,kBAAkB,EAAE;IAC9B,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;QAEzE,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAEzC,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAA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