@neurodevs/node-tdd 0.2.5 → 1.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/.vscode/launch.json +52 -57
- package/.vscode/settings.json +61 -66
- package/.vscode/tasks.json +98 -129
- package/README.md +1 -0
- package/build/.spruce/settings.json +3 -10
- package/build/__tests__/MockFetch.d.ts +18 -0
- package/build/__tests__/MockFetch.js +55 -0
- package/build/__tests__/MockFetch.js.map +1 -0
- package/build/__tests__/{impl → behavioral}/AbstractModuleTest.test.d.ts +2 -3
- package/build/__tests__/{impl → behavioral}/AbstractModuleTest.test.js +3 -12
- package/build/__tests__/behavioral/AbstractModuleTest.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.d.ts +5 -0
- package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.js +34 -0
- package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/Assert.test.d.ts +45 -0
- package/build/__tests__/behavioral/utilities/Assert.test.js +645 -0
- package/build/__tests__/behavioral/utilities/Assert.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.d.ts +4 -0
- package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.js +23 -0
- package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/MockFetch.test.d.ts +28 -0
- package/build/__tests__/behavioral/utilities/MockFetch.test.js +211 -0
- package/build/__tests__/behavioral/utilities/MockFetch.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/StackCleaner.test.d.ts +4 -0
- package/build/__tests__/behavioral/utilities/StackCleaner.test.js +46 -0
- package/build/__tests__/behavioral/utilities/StackCleaner.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.d.ts +7 -0
- package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.js +32 -0
- package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.d.ts +4 -0
- package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.js +19 -0
- package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/Stringify.test.d.ts +5 -0
- package/build/__tests__/behavioral/utilities/Stringify.test.js +127 -0
- package/build/__tests__/behavioral/utilities/Stringify.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.d.ts +7 -0
- package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.js +38 -0
- package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestOnBasic.test.d.ts +12 -0
- package/build/__tests__/behavioral/utilities/TestOnBasic.test.js +68 -0
- package/build/__tests__/behavioral/utilities/TestOnBasic.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestOnInstance.test.d.ts +28 -0
- package/build/__tests__/behavioral/utilities/TestOnInstance.test.js +289 -0
- package/build/__tests__/behavioral/utilities/TestOnInstance.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.d.ts +9 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.js +118 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.d.ts +5 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.js +78 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.d.ts +4 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.js +23 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.d.ts +4 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.js +24 -0
- package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestResolver.test.d.ts +7 -0
- package/build/__tests__/behavioral/utilities/TestResolver.test.js +38 -0
- package/build/__tests__/behavioral/utilities/TestResolver.test.js.map +1 -0
- package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.d.ts +4 -0
- package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.js +20 -0
- package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.js.map +1 -0
- package/build/__tests__/behavioral/workspace/JestJsonParser.test.d.ts +18 -0
- package/build/__tests__/behavioral/workspace/JestJsonParser.test.js +267 -0
- package/build/__tests__/behavioral/workspace/JestJsonParser.test.js.map +1 -0
- package/build/__tests__/behavioral/workspace/TestReporter.test.d.ts +16 -0
- package/build/__tests__/behavioral/workspace/TestReporter.test.js +227 -0
- package/build/__tests__/behavioral/workspace/TestReporter.test.js.map +1 -0
- package/build/__tests__/behavioral/workspace/TestRunner.test.d.ts +15 -0
- package/build/__tests__/behavioral/workspace/TestRunner.test.js +99 -0
- package/build/__tests__/behavioral/workspace/TestRunner.test.js.map +1 -0
- package/build/__tests__/behavioral/workspace/Widgets.test.d.ts +13 -0
- package/build/__tests__/behavioral/workspace/Widgets.test.js +99 -0
- package/build/__tests__/behavioral/workspace/Widgets.test.js.map +1 -0
- package/build/__tests__/mock-terminal-kit.d.ts +79 -0
- package/build/__tests__/mock-terminal-kit.js +103 -0
- package/build/__tests__/mock-terminal-kit.js.map +1 -0
- package/build/__tests__/support/AbstractForInstanceTest.d.ts +4 -0
- package/build/__tests__/support/AbstractForInstanceTest.js +9 -0
- package/build/__tests__/support/AbstractForInstanceTest.js.map +1 -0
- package/build/__tests__/support/AbstractLevelOneTest.d.ts +3 -0
- package/build/__tests__/support/AbstractLevelOneTest.js +4 -0
- package/build/__tests__/support/AbstractLevelOneTest.js.map +1 -0
- package/build/__tests__/support/AbstractLevelTwoTest.d.ts +7 -0
- package/build/__tests__/support/AbstractLevelTwoTest.js +14 -0
- package/build/__tests__/support/AbstractLevelTwoTest.js.map +1 -0
- package/build/__tests__/support/AbstractStaticTest.d.ts +7 -0
- package/build/__tests__/support/AbstractStaticTest.js +14 -0
- package/build/__tests__/support/AbstractStaticTest.js.map +1 -0
- package/build/__tests__/support/AbstractTestOnInstanceTest.d.ts +22 -0
- package/build/__tests__/support/AbstractTestOnInstanceTest.js +23 -0
- package/build/__tests__/support/AbstractTestOnInstanceTest.js.map +1 -0
- package/build/__tests__/support/AbstractTestOnInstanceWithHooks.d.ts +26 -0
- package/build/__tests__/support/AbstractTestOnInstanceWithHooks.js +59 -0
- package/build/__tests__/support/AbstractTestOnInstanceWithHooks.js.map +1 -0
- package/build/__tests__/support/jest.setup.d.ts +1 -0
- package/build/__tests__/support/jest.setup.js +4 -0
- package/build/__tests__/support/jest.setup.js.map +1 -0
- package/build/__tests__/support/onTestFileResult.d.ts +244 -0
- package/build/__tests__/support/onTestFileResult.js +980 -0
- package/build/__tests__/support/onTestFileResult.js.map +1 -0
- package/build/impl/AbstractModuleTest.d.ts +18 -4
- package/build/impl/AbstractModuleTest.js +47 -9
- package/build/impl/AbstractModuleTest.js.map +1 -1
- package/build/index.d.ts +4 -4
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/utilities/AssertionError.d.ts +3 -0
- package/build/utilities/AssertionError.js +12 -0
- package/build/utilities/AssertionError.js.map +1 -0
- package/build/utilities/StackCleaner.d.ts +4 -0
- package/build/utilities/StackCleaner.js +10 -0
- package/build/utilities/StackCleaner.js.map +1 -0
- package/build/utilities/TestDecoratorResolver.d.ts +35 -0
- package/build/utilities/TestDecoratorResolver.js +93 -0
- package/build/utilities/TestDecoratorResolver.js.map +1 -0
- package/build/utilities/assert.d.ts +49 -0
- package/build/utilities/assert.js +255 -0
- package/build/utilities/assert.js.map +1 -0
- package/build/utilities/assert.utility.d.ts +28 -0
- package/build/utilities/assert.utility.js +185 -0
- package/build/utilities/assert.utility.js.map +1 -0
- package/build/utilities/decorators.d.ts +9 -0
- package/build/utilities/decorators.js +133 -0
- package/build/utilities/decorators.js.map +1 -0
- package/build/workspace/CommandService.d.ts +49 -0
- package/build/workspace/CommandService.js +179 -0
- package/build/workspace/CommandService.js.map +1 -0
- package/build/workspace/JestJsonParser.d.ts +15 -0
- package/build/workspace/JestJsonParser.js +149 -0
- package/build/workspace/JestJsonParser.js.map +1 -0
- package/build/workspace/TKButtonWidget.d.ts +13 -0
- package/build/workspace/TKButtonWidget.js +37 -0
- package/build/workspace/TKButtonWidget.js.map +1 -0
- package/build/workspace/TestLogItemGenerator.d.ts +15 -0
- package/build/workspace/TestLogItemGenerator.js +142 -0
- package/build/workspace/TestLogItemGenerator.js.map +1 -0
- package/build/workspace/TestReporter.d.ts +103 -0
- package/build/workspace/TestReporter.js +677 -0
- package/build/workspace/TestReporter.js.map +1 -0
- package/build/workspace/TestRunner.d.ts +24 -0
- package/build/workspace/TestRunner.js +95 -0
- package/build/workspace/TestRunner.js.map +1 -0
- package/build/workspace/TkBaseWidget.d.ts +37 -0
- package/build/workspace/TkBaseWidget.js +185 -0
- package/build/workspace/TkBaseWidget.js.map +1 -0
- package/build/workspace/TkInputWidget.d.ts +16 -0
- package/build/workspace/TkInputWidget.js +64 -0
- package/build/workspace/TkInputWidget.js.map +1 -0
- package/build/workspace/TkLayoutCellWidget.d.ts +18 -0
- package/build/workspace/TkLayoutCellWidget.js +32 -0
- package/build/workspace/TkLayoutCellWidget.js.map +1 -0
- package/build/workspace/TkLayoutWidget.d.ts +34 -0
- package/build/workspace/TkLayoutWidget.js +130 -0
- package/build/workspace/TkLayoutWidget.js.map +1 -0
- package/build/workspace/TkMenuBarWidget.d.ts +13 -0
- package/build/workspace/TkMenuBarWidget.js +71 -0
- package/build/workspace/TkMenuBarWidget.js.map +1 -0
- package/build/workspace/TkPopupWidget.d.ts +16 -0
- package/build/workspace/TkPopupWidget.js +36 -0
- package/build/workspace/TkPopupWidget.js.map +1 -0
- package/build/workspace/TkProgressBarWidget.d.ts +10 -0
- package/build/workspace/TkProgressBarWidget.js +39 -0
- package/build/workspace/TkProgressBarWidget.js.map +1 -0
- package/build/workspace/TkTextWidget.d.ts +20 -0
- package/build/workspace/TkTextWidget.js +115 -0
- package/build/workspace/TkTextWidget.js.map +1 -0
- package/build/workspace/TkWindowWidget.d.ts +22 -0
- package/build/workspace/TkWindowWidget.js +88 -0
- package/build/workspace/TkWindowWidget.js.map +1 -0
- package/build/workspace/WidgetFactory.d.ts +6 -0
- package/build/workspace/WidgetFactory.js +21 -0
- package/build/workspace/WidgetFactory.js.map +1 -0
- package/build/workspace/button.types.d.ts +15 -0
- package/build/workspace/button.types.js +6 -0
- package/build/workspace/button.types.js.map +1 -0
- package/build/workspace/duration.utility.d.ts +4 -0
- package/build/workspace/duration.utility.js +26 -0
- package/build/workspace/duration.utility.js.map +1 -0
- package/build/workspace/factory.types.d.ts +89 -0
- package/build/workspace/factory.types.js +37 -0
- package/build/workspace/factory.types.js.map +1 -0
- package/build/workspace/input.types.d.ts +18 -0
- package/build/workspace/input.types.js +7 -0
- package/build/workspace/input.types.js.map +1 -0
- package/build/workspace/keySelectChoices.d.ts +517 -0
- package/build/workspace/keySelectChoices.js +2 -0
- package/build/workspace/keySelectChoices.js.map +1 -0
- package/build/workspace/layout.types.d.ts +33 -0
- package/build/workspace/layout.types.js +2 -0
- package/build/workspace/layout.types.js.map +1 -0
- package/build/workspace/menuBar.types.d.ts +19 -0
- package/build/workspace/menuBar.types.js +6 -0
- package/build/workspace/menuBar.types.js.map +1 -0
- package/build/workspace/popup.types.d.ts +13 -0
- package/build/workspace/popup.types.js +6 -0
- package/build/workspace/popup.types.js.map +1 -0
- package/build/workspace/progressBar.types.d.ts +10 -0
- package/build/workspace/progressBar.types.js +2 -0
- package/build/workspace/progressBar.types.js.map +1 -0
- package/build/workspace/table.types.d.ts +6 -0
- package/build/workspace/table.types.js +2 -0
- package/build/workspace/table.types.js.map +1 -0
- package/build/workspace/termKit.utility.d.ts +12 -0
- package/build/workspace/termKit.utility.js +128 -0
- package/build/workspace/termKit.utility.js.map +1 -0
- package/build/workspace/test.types.d.ts +24 -0
- package/build/workspace/test.types.js +2 -0
- package/build/workspace/test.types.js.map +1 -0
- package/build/workspace/testRunner.cli.d.ts +1 -0
- package/build/workspace/testRunner.cli.js +149 -0
- package/build/workspace/testRunner.cli.js.map +1 -0
- package/build/workspace/text.types.d.ts +20 -0
- package/build/workspace/text.types.js +7 -0
- package/build/workspace/text.types.js.map +1 -0
- package/build/workspace/widget.utilities.d.ts +5 -0
- package/build/workspace/widget.utilities.js +20 -0
- package/build/workspace/widget.utilities.js.map +1 -0
- package/build/workspace/widgets.types.d.ts +66 -0
- package/build/workspace/widgets.types.js +2 -0
- package/build/workspace/widgets.types.js.map +1 -0
- package/build/workspace/window.types.d.ts +18 -0
- package/build/workspace/window.types.js +9 -0
- package/build/workspace/window.types.js.map +1 -0
- package/eslint.config.js +3 -0
- package/package.json +31 -37
- package/prettier.config.js +3 -0
- package/src/.spruce/settings.json +3 -10
- package/src/__tests__/MockFetch.ts +100 -0
- package/src/__tests__/behavioral/AbstractModuleTest.test.ts +15 -0
- package/src/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.ts +31 -0
- package/src/__tests__/behavioral/utilities/Assert.test.ts +826 -0
- package/src/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.ts +14 -0
- package/src/__tests__/behavioral/utilities/MockFetch.test.ts +240 -0
- package/src/__tests__/behavioral/utilities/StackCleaner.test.ts +46 -0
- package/src/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.ts +34 -0
- package/src/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.ts +11 -0
- package/src/__tests__/behavioral/utilities/Stringify.test.ts +169 -0
- package/src/__tests__/behavioral/utilities/TestDecoratorResolver.test.ts +51 -0
- package/src/__tests__/behavioral/utilities/TestOnBasic.test.ts +62 -0
- package/src/__tests__/behavioral/utilities/TestOnInstance.test.ts +439 -0
- package/src/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.ts +237 -0
- package/src/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.ts +85 -0
- package/src/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.ts +14 -0
- package/src/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.ts +16 -0
- package/src/__tests__/behavioral/utilities/TestResolver.test.ts +48 -0
- package/src/__tests__/behavioral/utilities/TestResolverOnStatic.test.ts +12 -0
- package/src/__tests__/behavioral/workspace/JestJsonParser.test.ts +357 -0
- package/src/__tests__/behavioral/workspace/TestReporter.test.ts +257 -0
- package/src/__tests__/behavioral/workspace/TestRunner.test.ts +87 -0
- package/src/__tests__/behavioral/workspace/Widgets.test.ts +90 -0
- package/src/__tests__/mock-terminal-kit.ts +115 -0
- package/src/__tests__/support/AbstractForInstanceTest.ts +12 -0
- package/src/__tests__/support/AbstractLevelOneTest.ts +3 -0
- package/src/__tests__/support/AbstractLevelTwoTest.ts +16 -0
- package/src/__tests__/support/AbstractStaticTest.ts +16 -0
- package/src/__tests__/support/AbstractTestOnInstanceTest.ts +30 -0
- package/src/__tests__/support/AbstractTestOnInstanceWithHooks.ts +138 -0
- package/src/__tests__/support/jest.setup.ts +2 -0
- package/src/__tests__/support/onTestFileResult.ts +1008 -0
- package/src/impl/AbstractModuleTest.ts +59 -10
- package/src/index.ts +4 -4
- package/src/utilities/AssertionError.ts +14 -0
- package/src/utilities/StackCleaner.ts +14 -0
- package/src/utilities/TestDecoratorResolver.ts +118 -0
- package/src/utilities/assert.ts +583 -0
- package/src/utilities/assert.utility.ts +295 -0
- package/src/utilities/decorators.ts +167 -0
- package/src/workspace/CommandService.ts +256 -0
- package/src/workspace/JestJsonParser.ts +255 -0
- package/src/workspace/TKButtonWidget.ts +54 -0
- package/src/workspace/TestLogItemGenerator.ts +184 -0
- package/src/workspace/TestReporter.ts +865 -0
- package/src/workspace/TestRunner.ts +128 -0
- package/src/workspace/TkBaseWidget.ts +249 -0
- package/src/workspace/TkInputWidget.ts +83 -0
- package/src/workspace/TkLayoutCellWidget.ts +46 -0
- package/src/workspace/TkLayoutWidget.ts +181 -0
- package/src/workspace/TkMenuBarWidget.ts +95 -0
- package/src/workspace/TkPopupWidget.ts +47 -0
- package/src/workspace/TkProgressBarWidget.ts +54 -0
- package/src/workspace/TkTextWidget.ts +158 -0
- package/src/workspace/TkWindowWidget.ts +122 -0
- package/src/workspace/WidgetFactory.ts +33 -0
- package/src/workspace/button.types.ts +19 -0
- package/src/workspace/duration.utility.ts +34 -0
- package/src/workspace/factory.types.ts +101 -0
- package/src/workspace/input.types.ts +22 -0
- package/src/workspace/keySelectChoices.ts +134 -0
- package/src/workspace/layout.types.ts +40 -0
- package/src/workspace/menuBar.types.ts +24 -0
- package/src/workspace/popup.types.ts +17 -0
- package/src/workspace/progressBar.types.ts +13 -0
- package/src/workspace/table.types.ts +9 -0
- package/src/workspace/termKit.utility.ts +130 -0
- package/src/workspace/terminal-kit.d.ts +28 -0
- package/src/workspace/test.types.ts +34 -0
- package/src/workspace/testRunner.cli.ts +159 -0
- package/src/workspace/text.types.ts +26 -0
- package/src/workspace/widget.utilities.ts +35 -0
- package/src/workspace/widgets.types.ts +102 -0
- package/src/workspace/window.types.ts +22 -0
- package/tsconfig.json +23 -27
- package/build/__tests__/AbstractPackageTest.d.ts +0 -4
- package/build/__tests__/AbstractPackageTest.js +0 -7
- package/build/__tests__/AbstractPackageTest.js.map +0 -1
- package/build/__tests__/functions/assertFunction.test.d.ts +0 -5
- package/build/__tests__/functions/assertFunction.test.js +0 -23
- package/build/__tests__/functions/assertFunction.test.js.map +0 -1
- package/build/__tests__/functions/testFunction.test.d.ts +0 -5
- package/build/__tests__/functions/testFunction.test.js +0 -23
- package/build/__tests__/functions/testFunction.test.js.map +0 -1
- package/build/__tests__/impl/AbstractModuleTest.test.js.map +0 -1
- package/build/functions/assert.d.ts +0 -3
- package/build/functions/assert.js +0 -4
- package/build/functions/assert.js.map +0 -1
- package/build/functions/test.d.ts +0 -3
- package/build/functions/test.js +0 -4
- package/build/functions/test.js.map +0 -1
- package/eslint.config.mjs +0 -3
- package/src/__tests__/AbstractPackageTest.ts +0 -7
- package/src/__tests__/functions/assertFunction.test.ts +0 -22
- package/src/__tests__/functions/testFunction.test.ts +0 -22
- package/src/__tests__/impl/AbstractModuleTest.test.ts +0 -34
- package/src/functions/assert.ts +0 -4
- package/src/functions/test.ts +0 -4
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js'
|
|
2
|
+
import test from '../../../utilities/decorators.js'
|
|
3
|
+
import assert from '../../../utilities/assert.js'
|
|
4
|
+
import TestReporter, {
|
|
5
|
+
TestReporterOptions,
|
|
6
|
+
} from '../../../workspace/TestReporter.js'
|
|
7
|
+
|
|
8
|
+
export default class TestReporterTest extends AbstractModuleTest {
|
|
9
|
+
@test()
|
|
10
|
+
protected static async canInstantiateTestReporter() {
|
|
11
|
+
const reporter = this.TestReporter()
|
|
12
|
+
assert.isTruthy(reporter)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@test()
|
|
16
|
+
protected static async canInstantiateWithOptions() {
|
|
17
|
+
const reporter = this.TestReporter({
|
|
18
|
+
cwd: this.cwd,
|
|
19
|
+
watchMode: 'off',
|
|
20
|
+
status: 'ready',
|
|
21
|
+
isDebugging: false,
|
|
22
|
+
})
|
|
23
|
+
assert.isTruthy(reporter)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@test()
|
|
27
|
+
protected static async hasStartMethod() {
|
|
28
|
+
const reporter = this.TestReporter()
|
|
29
|
+
assert.isFunction(reporter.start)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@test()
|
|
33
|
+
protected static async hasDestroyMethod() {
|
|
34
|
+
const reporter = this.TestReporter()
|
|
35
|
+
assert.isFunction(reporter.destroy)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@test()
|
|
39
|
+
protected static async hasUpdateResultsMethod() {
|
|
40
|
+
const reporter = this.TestReporter()
|
|
41
|
+
assert.isFunction(reporter.updateResults)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@test()
|
|
45
|
+
protected static async hasSetStatusMethod() {
|
|
46
|
+
const reporter = this.TestReporter()
|
|
47
|
+
assert.isFunction(reporter.setStatus)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@test()
|
|
51
|
+
protected static async hasResetMethod() {
|
|
52
|
+
const reporter = this.TestReporter()
|
|
53
|
+
assert.isFunction(reporter.reset)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@test()
|
|
57
|
+
protected static async hasAppendErrorMethod() {
|
|
58
|
+
const reporter = this.TestReporter()
|
|
59
|
+
assert.isFunction(reporter.appendError)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@test()
|
|
63
|
+
protected static async throwsIfUpdateResultsCalledBeforeStart() {
|
|
64
|
+
const reporter = this.TestReporter()
|
|
65
|
+
assert.doesThrow(() => {
|
|
66
|
+
reporter.updateResults({ totalTestFiles: 0 })
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@test()
|
|
71
|
+
protected static async doesNotDestroyOnUncaughtException() {
|
|
72
|
+
const reporter = this.TestReporter()
|
|
73
|
+
let destroyCalled = false
|
|
74
|
+
let killHandler: ((payload: { code: any }) => void) | undefined
|
|
75
|
+
|
|
76
|
+
const fakeWidget: any = new Proxy(
|
|
77
|
+
{},
|
|
78
|
+
{
|
|
79
|
+
get: (_t, prop: string) => {
|
|
80
|
+
if (prop === 'getFrame') {
|
|
81
|
+
return () => ({
|
|
82
|
+
left: 0,
|
|
83
|
+
top: 0,
|
|
84
|
+
width: 100,
|
|
85
|
+
height: 50,
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
if (prop === 'getChildById') {
|
|
89
|
+
return () => null
|
|
90
|
+
}
|
|
91
|
+
if (prop === 'getRows') {
|
|
92
|
+
return () => [{}]
|
|
93
|
+
}
|
|
94
|
+
if (prop === 'getFocusedWidget') {
|
|
95
|
+
return () => null
|
|
96
|
+
}
|
|
97
|
+
if (prop === 'on') {
|
|
98
|
+
return (event: string, handler: any) => {
|
|
99
|
+
if (event === 'kill') {
|
|
100
|
+
killHandler = handler
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return () => fakeWidget
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
reporter.widgets = { Widget: () => fakeWidget }
|
|
110
|
+
reporter.destroy = async () => {
|
|
111
|
+
destroyCalled = true
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
await reporter.start()
|
|
115
|
+
|
|
116
|
+
assert.isTruthy(killHandler, 'kill handler must be registered')
|
|
117
|
+
|
|
118
|
+
killHandler!({
|
|
119
|
+
code: new Error('terminal-kit mouse boundary crash'),
|
|
120
|
+
})
|
|
121
|
+
assert.isFalse(
|
|
122
|
+
destroyCalled,
|
|
123
|
+
'uncaughtException must not destroy the UI'
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
killHandler!({ code: 0 })
|
|
127
|
+
assert.isTrue(
|
|
128
|
+
destroyCalled,
|
|
129
|
+
'real exit signal must still destroy the UI'
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
clearInterval(reporter.updateInterval)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@test()
|
|
136
|
+
protected static async grabsInputToResetMouseStateAfterCrash() {
|
|
137
|
+
const reporter = this.TestReporter()
|
|
138
|
+
let destroyCalled = false
|
|
139
|
+
let grabInputCalled = false
|
|
140
|
+
let killHandler: ((payload: { code: any }) => void) | undefined
|
|
141
|
+
|
|
142
|
+
const fakeTerm = {
|
|
143
|
+
grabInput: () => {
|
|
144
|
+
grabInputCalled = true
|
|
145
|
+
},
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const fakeWidget: any = new Proxy(
|
|
149
|
+
{},
|
|
150
|
+
{
|
|
151
|
+
get: (_t, prop: string) => {
|
|
152
|
+
if (prop === 'getFrame') {
|
|
153
|
+
return () => ({
|
|
154
|
+
left: 0,
|
|
155
|
+
top: 0,
|
|
156
|
+
width: 100,
|
|
157
|
+
height: 50,
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
if (prop === 'getChildById') {
|
|
161
|
+
return () => null
|
|
162
|
+
}
|
|
163
|
+
if (prop === 'getRows') {
|
|
164
|
+
return () => [{}]
|
|
165
|
+
}
|
|
166
|
+
if (prop === 'getFocusedWidget') {
|
|
167
|
+
return () => null
|
|
168
|
+
}
|
|
169
|
+
if (prop === 'term') {
|
|
170
|
+
return fakeTerm
|
|
171
|
+
}
|
|
172
|
+
if (prop === 'on') {
|
|
173
|
+
return (event: string, handler: any) => {
|
|
174
|
+
if (event === 'kill') {
|
|
175
|
+
killHandler = handler
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return () => fakeWidget
|
|
180
|
+
},
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
reporter.widgets = { Widget: () => fakeWidget }
|
|
185
|
+
reporter.destroy = async () => {
|
|
186
|
+
destroyCalled = true
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
await reporter.start()
|
|
190
|
+
|
|
191
|
+
assert.isTruthy(killHandler, 'kill handler must be registered')
|
|
192
|
+
|
|
193
|
+
killHandler!({
|
|
194
|
+
code: new Error('terminal-kit mouse boundary crash'),
|
|
195
|
+
})
|
|
196
|
+
assert.isFalse(
|
|
197
|
+
destroyCalled,
|
|
198
|
+
'uncaughtException must not destroy the UI'
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
killHandler!({ code: 0 })
|
|
202
|
+
assert.isTrue(
|
|
203
|
+
destroyCalled,
|
|
204
|
+
'real exit signal must still destroy the UI'
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
assert.isTrue(
|
|
208
|
+
grabInputCalled,
|
|
209
|
+
'grabInput must be called to reset mouse state after terminal crash'
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
clearInterval(reporter.updateInterval)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@test()
|
|
216
|
+
protected static async errorLogIsCreatedWithFocusableSetToFalse() {
|
|
217
|
+
const reporter = this.TestReporter() as any
|
|
218
|
+
let capturedTextOptions: any
|
|
219
|
+
|
|
220
|
+
const fakeCell = { getFrame: () => ({ width: 100, height: 50 }) }
|
|
221
|
+
|
|
222
|
+
reporter.orientation = 'landscape'
|
|
223
|
+
|
|
224
|
+
reporter.bottomLayout = {
|
|
225
|
+
getRows: () => [{ id: 'row_1' }],
|
|
226
|
+
addColumn: () => {},
|
|
227
|
+
setColumnWidth: () => {},
|
|
228
|
+
updateLayout: () => {},
|
|
229
|
+
getChildById: (id: string) => {
|
|
230
|
+
return id === 'errors' ? fakeCell : null
|
|
231
|
+
},
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
reporter.widgets = {
|
|
235
|
+
Widget: (type: string, options: any) => {
|
|
236
|
+
if (type === 'text') {
|
|
237
|
+
capturedTextOptions = options
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
on: () => {},
|
|
241
|
+
getFrame: () => ({ width: 100, height: 50 }),
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
reporter.dropInErrorLog()
|
|
247
|
+
|
|
248
|
+
assert.isFalse(
|
|
249
|
+
capturedTextOptions?.focusable,
|
|
250
|
+
'errorLog must be created with focusable: false to prevent UI lockup on click'
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
private static TestReporter(options?: TestReporterOptions) {
|
|
255
|
+
return new TestReporter(options) as any
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js'
|
|
2
|
+
import test from '../../../utilities/decorators.js'
|
|
3
|
+
import assert from '../../../utilities/assert.js'
|
|
4
|
+
import TestRunner from '../../../workspace/TestRunner.js'
|
|
5
|
+
import CommandServiceImpl from '../../../workspace/CommandService.js'
|
|
6
|
+
|
|
7
|
+
export default class TestRunnerTest extends AbstractModuleTest {
|
|
8
|
+
private static runner: TestRunner
|
|
9
|
+
|
|
10
|
+
protected static async beforeEach() {
|
|
11
|
+
await super.beforeEach()
|
|
12
|
+
const commandService = new CommandServiceImpl(this.cwd)
|
|
13
|
+
this.runner = new TestRunner({ cwd: this.cwd, commandService })
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@test()
|
|
17
|
+
protected static async canInstantiateTestRunner() {
|
|
18
|
+
assert.isTruthy(this.runner)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@test()
|
|
22
|
+
protected static async hasHasFailedTestsMethod() {
|
|
23
|
+
assert.isFunction(this.runner.hasFailedTests)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@test()
|
|
27
|
+
protected static async hasHasSkippedTestsMethod() {
|
|
28
|
+
assert.isFunction(this.runner.hasSkippedTests)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@test()
|
|
32
|
+
protected static async hasKillMethod() {
|
|
33
|
+
assert.isFunction(this.runner.kill)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@test()
|
|
37
|
+
protected static async hasRunMethod() {
|
|
38
|
+
assert.isFunction(this.runner.run)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@test()
|
|
42
|
+
protected static async hasFailedTestsReturnsFalseByDefault() {
|
|
43
|
+
assert.isFalse(this.runner.hasFailedTests())
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@test()
|
|
47
|
+
protected static async hasSkippedTestsReturnsFalseByDefault() {
|
|
48
|
+
assert.isFalse(this.runner.hasSkippedTests())
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@test()
|
|
52
|
+
protected static async emitsDidUpdateEvent() {
|
|
53
|
+
let emitted = false
|
|
54
|
+
this.runner.on('did-update', () => {
|
|
55
|
+
emitted = true
|
|
56
|
+
})
|
|
57
|
+
assert.isFalse(emitted)
|
|
58
|
+
this.runner.emit('did-update', { results: { totalTestFiles: 0 } })
|
|
59
|
+
assert.isTrue(emitted)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@test()
|
|
63
|
+
protected static async emitsDidErrorEvent() {
|
|
64
|
+
let errorMessage = ''
|
|
65
|
+
this.runner.on('did-error', (payload: { message: string }) => {
|
|
66
|
+
errorMessage = payload.message
|
|
67
|
+
})
|
|
68
|
+
this.runner.emit('did-error', { message: 'test error' })
|
|
69
|
+
assert.isEqual(errorMessage, 'test error')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@test()
|
|
73
|
+
protected static async passesNodeNoWarningsToCommandService() {
|
|
74
|
+
let capturedEnv: Record<string, any> | undefined
|
|
75
|
+
|
|
76
|
+
const commandService = new CommandServiceImpl(this.cwd)
|
|
77
|
+
commandService.execute = async (_cmd: string, options?: any) => {
|
|
78
|
+
capturedEnv = options?.env
|
|
79
|
+
return { stdout: '' }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const runner = new TestRunner({ cwd: this.cwd, commandService })
|
|
83
|
+
await runner.run()
|
|
84
|
+
|
|
85
|
+
assert.isEqual(capturedEnv?.NODE_NO_WARNINGS, '1')
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js'
|
|
2
|
+
import assert from '../../../utilities/assert.js'
|
|
3
|
+
import test from '../../../utilities/decorators.js'
|
|
4
|
+
import WidgetFactory from '../../../workspace/WidgetFactory.js'
|
|
5
|
+
|
|
6
|
+
export default class WidgetsTest extends AbstractModuleTest {
|
|
7
|
+
private static factory: WidgetFactory
|
|
8
|
+
|
|
9
|
+
protected static async beforeEach() {
|
|
10
|
+
await super.beforeEach()
|
|
11
|
+
this.factory = new WidgetFactory()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@test()
|
|
15
|
+
protected static async canCreateFactory() {
|
|
16
|
+
assert.isTruthy(this.factory)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@test()
|
|
20
|
+
protected static async canCreateTextWidget() {
|
|
21
|
+
const log = this.buildText()
|
|
22
|
+
assert.isTruthy(log)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@test()
|
|
26
|
+
protected static async setsStartingFrame() {
|
|
27
|
+
const text = this.buildText()
|
|
28
|
+
assert.isEqualDeep(text.getFrame(), {
|
|
29
|
+
left: 0,
|
|
30
|
+
top: 0,
|
|
31
|
+
width: 4,
|
|
32
|
+
height: 4,
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@test()
|
|
37
|
+
protected static canCreateWindow() {
|
|
38
|
+
const window = this.factory.Widget('window', {})
|
|
39
|
+
assert.isTruthy(window)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@test()
|
|
43
|
+
protected static canCreateProgressBar() {
|
|
44
|
+
const progress = this.factory.Widget('progressBar', {
|
|
45
|
+
progress: 0,
|
|
46
|
+
})
|
|
47
|
+
assert.isTruthy(progress)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@test()
|
|
51
|
+
protected static canCreateText() {
|
|
52
|
+
const text = this.factory.Widget('text', {})
|
|
53
|
+
assert.isTruthy(text)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@test.skip('enable when ready to fake termkit')
|
|
57
|
+
protected static canCreateLayout() {
|
|
58
|
+
const window = this.factory.Widget('window', {})
|
|
59
|
+
const layout = this.factory.Widget('layout', {
|
|
60
|
+
parent: window,
|
|
61
|
+
width: '100%',
|
|
62
|
+
rows: [
|
|
63
|
+
{
|
|
64
|
+
id: 'row_1',
|
|
65
|
+
height: '100%',
|
|
66
|
+
columns: [
|
|
67
|
+
{
|
|
68
|
+
id: 'column_1',
|
|
69
|
+
width: '100%',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
})
|
|
75
|
+
assert.isTruthy(layout)
|
|
76
|
+
|
|
77
|
+
const column = layout.getChildById('results')
|
|
78
|
+
|
|
79
|
+
assert.isTruthy(column)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private static buildText() {
|
|
83
|
+
return this.factory.Widget('text', {
|
|
84
|
+
left: 0,
|
|
85
|
+
top: 0,
|
|
86
|
+
width: 4,
|
|
87
|
+
height: 4,
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export class FakeElement {
|
|
2
|
+
public outputX: number
|
|
3
|
+
public outputY: number
|
|
4
|
+
public outputWidth: number
|
|
5
|
+
public outputHeight: number
|
|
6
|
+
public constructorOptions: Record<string, any>
|
|
7
|
+
private handlers: Record<string, Function[]> = {}
|
|
8
|
+
|
|
9
|
+
public constructor(options: Record<string, any> = {}) {
|
|
10
|
+
this.constructorOptions = options
|
|
11
|
+
this.outputX = options.x ?? 0
|
|
12
|
+
this.outputY = options.y ?? 0
|
|
13
|
+
this.outputWidth = options.width ?? 0
|
|
14
|
+
this.outputHeight = options.height ?? 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public on(event: string, cb: Function) {
|
|
18
|
+
if (!this.handlers[event]) {
|
|
19
|
+
this.handlers[event] = []
|
|
20
|
+
}
|
|
21
|
+
this.handlers[event].push(cb)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public draw() {}
|
|
25
|
+
public destroy() {}
|
|
26
|
+
public resize(options: Record<string, any>) {
|
|
27
|
+
if (options.x !== undefined) {
|
|
28
|
+
this.outputX = options.x
|
|
29
|
+
}
|
|
30
|
+
if (options.y !== undefined) {
|
|
31
|
+
this.outputY = options.y
|
|
32
|
+
}
|
|
33
|
+
if (options.width !== undefined) {
|
|
34
|
+
this.outputWidth = options.width
|
|
35
|
+
}
|
|
36
|
+
if (options.height !== undefined) {
|
|
37
|
+
this.outputHeight = options.height
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class TextBox extends FakeElement {
|
|
43
|
+
public content = ''
|
|
44
|
+
public scrollY = 0
|
|
45
|
+
public scrollX = 0
|
|
46
|
+
public textAreaHeight = 0
|
|
47
|
+
public textBuffer = {
|
|
48
|
+
cy: 0,
|
|
49
|
+
selectionRegion: null as any,
|
|
50
|
+
setSelectionRegion(_: any) {},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public setContent(content: string) {
|
|
54
|
+
this.content = content
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public setSizeAndPosition(opts: Record<string, any>) {
|
|
58
|
+
this.resize(opts)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public scrollToBottom() {}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export class Bar extends FakeElement {
|
|
65
|
+
public setValue(_: number) {}
|
|
66
|
+
public setContent(_: string) {}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class Layout extends FakeElement {
|
|
70
|
+
public computed = { xmin: 0, ymin: 0, width: 80, height: 24 }
|
|
71
|
+
public zChildren: any[] = []
|
|
72
|
+
public updateLayout() {}
|
|
73
|
+
public addRow(_row: any) {}
|
|
74
|
+
public setRowHeight(_idx: number, _h: any) {}
|
|
75
|
+
public addColumn(_idx: number, _col: any) {}
|
|
76
|
+
public setColumnWidth(_opts: any) {}
|
|
77
|
+
public getRows() {
|
|
78
|
+
return []
|
|
79
|
+
}
|
|
80
|
+
public off(_event: string, _cb: any) {}
|
|
81
|
+
public onParentResize() {}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class Palette {}
|
|
85
|
+
|
|
86
|
+
const fakeDocument = {
|
|
87
|
+
eventSource: { on(_event: string, _cb: any) {} },
|
|
88
|
+
__widget: null as any,
|
|
89
|
+
inputWidth: 120,
|
|
90
|
+
inputHeight: 40,
|
|
91
|
+
focusElement: { __widget: null },
|
|
92
|
+
giveFocusTo: (_el: any) => {},
|
|
93
|
+
destroy: () => {},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const fakeTerm = {
|
|
97
|
+
createDocument: () => fakeDocument,
|
|
98
|
+
grabInput: (_opts: any) => {},
|
|
99
|
+
on: (_event: string, _cb: any) => {},
|
|
100
|
+
hideCursor: (_v: boolean) => {},
|
|
101
|
+
windowTitle: (_t: string) => {},
|
|
102
|
+
styleReset: () => {},
|
|
103
|
+
clear: () => {},
|
|
104
|
+
removeAllListeners: () => {},
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const terminalKit = {
|
|
108
|
+
terminal: fakeTerm,
|
|
109
|
+
TextBox,
|
|
110
|
+
Bar,
|
|
111
|
+
Layout,
|
|
112
|
+
Palette,
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default terminalKit
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import assert from '../../utilities/assert.js'
|
|
2
|
+
|
|
3
|
+
export default abstract class AbstractForInstanceTest {
|
|
4
|
+
protected static wasBeforeAllCalled = false
|
|
5
|
+
public static async beforeAll() {
|
|
6
|
+
assert.isFalse(
|
|
7
|
+
this.wasBeforeAllCalled,
|
|
8
|
+
'beforeAll in parent class not referrenced'
|
|
9
|
+
)
|
|
10
|
+
this.wasBeforeAllCalled = true
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../impl/AbstractModuleTest.js'
|
|
2
|
+
|
|
3
|
+
export default abstract class AbstractBeforeAllLevelTwoTest extends AbstractModuleTest {
|
|
4
|
+
protected static wasBeforeAllLevelTwoCalled = false
|
|
5
|
+
protected wasBeforeEachLevelTwoCalled = false
|
|
6
|
+
|
|
7
|
+
protected static async beforeAll() {
|
|
8
|
+
await super.beforeAll()
|
|
9
|
+
this.wasBeforeAllLevelTwoCalled = true
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
protected async beforeEach() {
|
|
13
|
+
await super.beforeEach()
|
|
14
|
+
this.wasBeforeEachLevelTwoCalled = true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../impl/AbstractModuleTest.js'
|
|
2
|
+
|
|
3
|
+
export default abstract class AbstractStaticTest extends AbstractModuleTest {
|
|
4
|
+
protected static didCallAnotherStaticMethodInBeforeEach = false
|
|
5
|
+
protected static didSetInBeforeAll: boolean
|
|
6
|
+
|
|
7
|
+
protected static async beforeAll() {
|
|
8
|
+
await super.beforeAll()
|
|
9
|
+
this.callAnotherStaticMethod()
|
|
10
|
+
this.didSetInBeforeAll = true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
private static callAnotherStaticMethod() {
|
|
14
|
+
this.didCallAnotherStaticMethodInBeforeEach = true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../impl/AbstractModuleTest.js'
|
|
2
|
+
|
|
3
|
+
export default abstract class AbstractTestOnInstanceTest extends AbstractModuleTest {
|
|
4
|
+
public static beforeAllCount = 0
|
|
5
|
+
public static beforeEachCount = 0
|
|
6
|
+
public static afterEachCount = 0
|
|
7
|
+
|
|
8
|
+
public static beforeBeforeAllCount = 0
|
|
9
|
+
public static beforeBeforeAllCount2 = 0
|
|
10
|
+
public static afterBeforeAllCount = 0
|
|
11
|
+
public static afterBeforeAllCount2 = 0
|
|
12
|
+
|
|
13
|
+
public static beforeBeforeEach = 0
|
|
14
|
+
public static beforeBeforeEach2 = 0
|
|
15
|
+
|
|
16
|
+
public static afterBeforeEach = 0
|
|
17
|
+
public static afterBeforeEach2 = 0
|
|
18
|
+
|
|
19
|
+
public static beforeAfterEach = 0
|
|
20
|
+
public static beforeAfterEach2 = 0
|
|
21
|
+
|
|
22
|
+
public static afterAfterEach = 0
|
|
23
|
+
public static afterAfterEach2 = 0
|
|
24
|
+
|
|
25
|
+
public static beforeAfterAll = 0
|
|
26
|
+
public static beforeAfterAll2 = 0
|
|
27
|
+
|
|
28
|
+
public static afterAfterAll = 0
|
|
29
|
+
public static afterAfterAll2 = 0
|
|
30
|
+
}
|