@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,439 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js'
|
|
2
|
+
import test, { suite } from '../../../utilities/decorators.js'
|
|
3
|
+
import assert from '../../../utilities/assert.js'
|
|
4
|
+
import TestDecoratorResolver from '../../../utilities/TestDecoratorResolver.js'
|
|
5
|
+
|
|
6
|
+
let beforeAllCount = 0
|
|
7
|
+
let beforeEachCount = 0
|
|
8
|
+
let afterEachCount = 0
|
|
9
|
+
|
|
10
|
+
let willCallBeforeAllCount = 0
|
|
11
|
+
let willCallBeforeAllCount2 = 0
|
|
12
|
+
let didCallBeforeAllCount = 0
|
|
13
|
+
let didCallBeforeAllCount2 = 0
|
|
14
|
+
|
|
15
|
+
let willCallBeforeEachCount = 0
|
|
16
|
+
let willCallBeforeEachCount2 = 0
|
|
17
|
+
|
|
18
|
+
let didCallBeforeEachCount = 0
|
|
19
|
+
let didCallBeforeEachCount2 = 0
|
|
20
|
+
|
|
21
|
+
let willCallAfterEachCount = 0
|
|
22
|
+
let willCallAfterEachCount2 = 0
|
|
23
|
+
|
|
24
|
+
let didCallAfterEachCount = 0
|
|
25
|
+
let didCallAfterEachCount2 = 0
|
|
26
|
+
|
|
27
|
+
let willCallAfterAllCount = 0
|
|
28
|
+
let willCallAfterAllCount2 = 0
|
|
29
|
+
|
|
30
|
+
let didCallAfterAllCount = 0
|
|
31
|
+
let didCallAfterAllCount2 = 0
|
|
32
|
+
|
|
33
|
+
let willCallBeforeEachTest: any
|
|
34
|
+
let didCallBeforeEachTest: any
|
|
35
|
+
let willCallAfterEachTest: any
|
|
36
|
+
let didCallAfterEachTest: any
|
|
37
|
+
|
|
38
|
+
let willCallAfterAllTest: any
|
|
39
|
+
let didCallAfterAllTest: any
|
|
40
|
+
let willCallBeforeAllTest: any
|
|
41
|
+
let didCallBeforeAllTest: any
|
|
42
|
+
|
|
43
|
+
@suite()
|
|
44
|
+
export default class TestOnInstanceTest extends AbstractModuleTest {
|
|
45
|
+
private wasInstancePropertySet = false
|
|
46
|
+
private beforeEachCount = 0
|
|
47
|
+
private static instanceToCheckAfterEach?: TestOnInstanceTest
|
|
48
|
+
|
|
49
|
+
protected static async beforeAll() {
|
|
50
|
+
assert.isEqual(
|
|
51
|
+
willCallBeforeAllCount,
|
|
52
|
+
1,
|
|
53
|
+
'willCallBeforeAllCount missmatch'
|
|
54
|
+
)
|
|
55
|
+
assert.isEqual(
|
|
56
|
+
willCallBeforeAllCount2,
|
|
57
|
+
1,
|
|
58
|
+
'willCallBeforeAllCount2 missmatch'
|
|
59
|
+
)
|
|
60
|
+
assert.isEqual(didCallBeforeAllCount, 0, 'didCallBeforeAll missmatch')
|
|
61
|
+
assert.isEqual(
|
|
62
|
+
didCallBeforeAllCount2,
|
|
63
|
+
0,
|
|
64
|
+
'didCallBeforeAll missmatched'
|
|
65
|
+
)
|
|
66
|
+
beforeAllCount += 1
|
|
67
|
+
|
|
68
|
+
assert.isEqual(this, TestOnInstanceTest)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
protected async beforeEach() {
|
|
72
|
+
beforeEachCount += 1
|
|
73
|
+
|
|
74
|
+
assert.isEqual(
|
|
75
|
+
willCallBeforeEachCount,
|
|
76
|
+
beforeEachCount,
|
|
77
|
+
'willCallBeforeEach not called first'
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
assert.isEqual(
|
|
81
|
+
willCallBeforeEachCount2,
|
|
82
|
+
beforeEachCount,
|
|
83
|
+
'willCallBeforeEach not called second time'
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
assert.isEqual(
|
|
87
|
+
didCallBeforeEachCount,
|
|
88
|
+
beforeEachCount - 1,
|
|
89
|
+
'afterBeforeEach called too soon'
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
assert.isEqual(
|
|
93
|
+
didCallBeforeEachCount2,
|
|
94
|
+
beforeEachCount - 1,
|
|
95
|
+
'afterBeforeEach called too soon'
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
this.beforeEachCount++
|
|
99
|
+
assert.isInstanceOf(this, TestOnInstanceTest)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
protected async afterEach() {
|
|
103
|
+
afterEachCount += 1
|
|
104
|
+
|
|
105
|
+
assert.isEqual(
|
|
106
|
+
willCallAfterEachCount,
|
|
107
|
+
afterEachCount,
|
|
108
|
+
'beforeAfterEach not called first'
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
assert.isEqual(
|
|
112
|
+
willCallAfterEachCount2,
|
|
113
|
+
afterEachCount,
|
|
114
|
+
'beforeAfterEach not called second time'
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
assert.isEqual(
|
|
118
|
+
didCallAfterEachCount,
|
|
119
|
+
afterEachCount - 1,
|
|
120
|
+
'afterAfterEach called too soon'
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
assert.isEqual(
|
|
124
|
+
didCallAfterEachCount2,
|
|
125
|
+
afterEachCount - 1,
|
|
126
|
+
'afterAfterEach called too soon'
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
assert.isEqual(
|
|
130
|
+
willCallAfterAllCount,
|
|
131
|
+
0,
|
|
132
|
+
'beforeAfterAll called too soon'
|
|
133
|
+
)
|
|
134
|
+
assert.isEqual(
|
|
135
|
+
willCallAfterAllCount2,
|
|
136
|
+
0,
|
|
137
|
+
'beforeAfterAll called too soon'
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
assert.isInstanceOf(this, TestOnInstanceTest)
|
|
141
|
+
if (TestOnInstanceTest.instanceToCheckAfterEach) {
|
|
142
|
+
assert.isEqual(this, TestOnInstanceTest.instanceToCheckAfterEach)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
protected static async afterAll() {
|
|
147
|
+
assert.isTruthy(TestOnInstanceTest.instanceToCheckAfterEach)
|
|
148
|
+
assert.isEqual(beforeAllCount, 1, 'willCallBeforeAll not called once')
|
|
149
|
+
assert.isEqual(
|
|
150
|
+
didCallBeforeAllCount,
|
|
151
|
+
1,
|
|
152
|
+
'didCallBeforeAll not called first'
|
|
153
|
+
)
|
|
154
|
+
assert.isEqual(
|
|
155
|
+
didCallBeforeAllCount2,
|
|
156
|
+
1,
|
|
157
|
+
'didCallBeforeAll not called second time'
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
assert.isEqual(
|
|
161
|
+
willCallAfterAllCount,
|
|
162
|
+
1,
|
|
163
|
+
'beforeAfterAll was not called'
|
|
164
|
+
)
|
|
165
|
+
assert.isEqual(
|
|
166
|
+
willCallAfterAllCount2,
|
|
167
|
+
1,
|
|
168
|
+
'beforeAfterAll was not called'
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
assert.isEqual(this, TestOnInstanceTest)
|
|
172
|
+
|
|
173
|
+
assert.isEqual(
|
|
174
|
+
didCallAfterAllCount,
|
|
175
|
+
0,
|
|
176
|
+
'didCallAfterAll called too soon'
|
|
177
|
+
)
|
|
178
|
+
assert.isEqual(
|
|
179
|
+
didCallAfterAllCount2,
|
|
180
|
+
0,
|
|
181
|
+
'didCallAfterAll called too soon'
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
assert.isEqual(
|
|
185
|
+
willCallBeforeAllTest,
|
|
186
|
+
TestOnInstanceTest,
|
|
187
|
+
'willCallBeforeAll did not pass test class'
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
setTimeout(() => {
|
|
191
|
+
assert.isEqual(
|
|
192
|
+
didCallAfterAllCount,
|
|
193
|
+
1,
|
|
194
|
+
'didCallAfterAll not called'
|
|
195
|
+
)
|
|
196
|
+
assert.isEqual(
|
|
197
|
+
didCallAfterAllCount2,
|
|
198
|
+
1,
|
|
199
|
+
'didCallAfterAll not called'
|
|
200
|
+
)
|
|
201
|
+
assert.isEqual(
|
|
202
|
+
willCallBeforeAllTest,
|
|
203
|
+
TestOnInstanceTest,
|
|
204
|
+
'willCallBeforeAll did not pass test class'
|
|
205
|
+
)
|
|
206
|
+
assert.isEqual(
|
|
207
|
+
didCallBeforeAllTest,
|
|
208
|
+
TestOnInstanceTest,
|
|
209
|
+
'didCallBeforeAll did not pass test class'
|
|
210
|
+
)
|
|
211
|
+
assert.isEqual(
|
|
212
|
+
willCallAfterAllTest,
|
|
213
|
+
TestOnInstanceTest,
|
|
214
|
+
'beforeAfterAll did not pass test class'
|
|
215
|
+
)
|
|
216
|
+
assert.isEqual(
|
|
217
|
+
didCallAfterAllTest,
|
|
218
|
+
TestOnInstanceTest,
|
|
219
|
+
'didCallAfterAll did not pass test class'
|
|
220
|
+
)
|
|
221
|
+
}, 1)
|
|
222
|
+
|
|
223
|
+
assert.isEqual(
|
|
224
|
+
willCallBeforeEachTest,
|
|
225
|
+
TestOnInstanceTest.instanceToCheckAfterEach,
|
|
226
|
+
'Did not pass test instance to beforeBeforeEach'
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
assert.isEqual(
|
|
230
|
+
didCallBeforeEachTest,
|
|
231
|
+
TestOnInstanceTest.instanceToCheckAfterEach,
|
|
232
|
+
'Did not pass test instance to afterBeforeEach'
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
assert.isEqual(
|
|
236
|
+
willCallAfterEachTest,
|
|
237
|
+
TestOnInstanceTest.instanceToCheckAfterEach,
|
|
238
|
+
'Did not pass test instance to beforeAfterEach'
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
assert.isEqual(
|
|
242
|
+
didCallAfterEachTest,
|
|
243
|
+
TestOnInstanceTest.instanceToCheckAfterEach,
|
|
244
|
+
'Did not pass test instance to afterAfterEach'
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@test()
|
|
249
|
+
protected async doesCallBeforeAll() {
|
|
250
|
+
assert.isEqual(beforeAllCount, 1, 'Did not call beforeAll')
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@test()
|
|
254
|
+
protected async basicPassingTest() {
|
|
255
|
+
assert.isTrue(true)
|
|
256
|
+
assert.isFalse(false)
|
|
257
|
+
assert.isEqual(5, 5, `Thing's don't equal`)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@test('can pass variables to test handler from decorator', 'hello', 'world')
|
|
261
|
+
protected async canAccessVarsFromDecorator(hello: string, world: string) {
|
|
262
|
+
assert.isEqual(hello, 'hello')
|
|
263
|
+
assert.isEqual(world, 'world')
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@test()
|
|
267
|
+
protected async calledBeforeAndAfterEach() {
|
|
268
|
+
assert.isEqual(beforeEachCount, 4)
|
|
269
|
+
assert.isEqual(afterEachCount, 3)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@test()
|
|
273
|
+
protected async asyncWaits() {
|
|
274
|
+
const results = await this.wait(10)
|
|
275
|
+
assert.isTruthy(results)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@test()
|
|
279
|
+
protected async settingInstanceProperty() {
|
|
280
|
+
this.wasInstancePropertySet = true
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@test()
|
|
284
|
+
protected async shouldBeResetNow() {
|
|
285
|
+
assert.isFalse(this.wasInstancePropertySet)
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
@test.skip()
|
|
289
|
+
protected async skippedTestShouldNotRun() {
|
|
290
|
+
assert.fail('This test should not run')
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
@test('can wait for 10', 10)
|
|
294
|
+
@test('can wait for 20', 20)
|
|
295
|
+
protected async shouldBeAbleToWait(waitMs: number) {
|
|
296
|
+
const now = Date.now()
|
|
297
|
+
await this.wait(waitMs)
|
|
298
|
+
const after = Date.now()
|
|
299
|
+
|
|
300
|
+
assert.isBetweenInclusive(after - now, waitMs * 0.8, waitMs + 20)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@test('can log simple message', ['hey'])
|
|
304
|
+
@test('can log multiple messages', ['hey', 'there'])
|
|
305
|
+
protected async canLog(messages: string[]) {
|
|
306
|
+
let passedMessages: string | undefined
|
|
307
|
+
|
|
308
|
+
//@ts-ignore
|
|
309
|
+
process.stderr.write = (message) => {
|
|
310
|
+
passedMessages = message as string
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const expected = messages.join(' ')
|
|
314
|
+
|
|
315
|
+
this.log(...messages)
|
|
316
|
+
|
|
317
|
+
assert.isEqual(passedMessages, expected)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@test('simple single parameter', 'test')
|
|
321
|
+
protected passesThroughSimpleParameter(param1: any) {
|
|
322
|
+
assert.isEqual(param1, 'test')
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
@test('array singe parameter', [1])
|
|
326
|
+
protected passesThroughARrayParameter(param1: any) {
|
|
327
|
+
assert.isEqualDeep(param1, [1])
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
@test()
|
|
331
|
+
protected cwdShouldbeSet() {
|
|
332
|
+
assert.isEqual(this.cwd, process.cwd())
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@test()
|
|
336
|
+
protected async resolvePathShouldWork() {
|
|
337
|
+
await AbstractModuleTest.beforeAll()
|
|
338
|
+
this.assertResolvePathReturnsSameAsStatic(['test'])
|
|
339
|
+
this.assertResolvePathReturnsSameAsStatic(['test', 'behavioral'])
|
|
340
|
+
this.assertResolvePathReturnsSameAsStatic([
|
|
341
|
+
'test',
|
|
342
|
+
'behavioral',
|
|
343
|
+
'TestOnInstance.test.ts',
|
|
344
|
+
])
|
|
345
|
+
this.assertResolvePathReturnsSameAsStatic(['/ok'])
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@test()
|
|
349
|
+
protected async beforeEachCalledOnSameInstance() {
|
|
350
|
+
assert.isEqual(this.beforeEachCount, 1)
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@test.skip()
|
|
354
|
+
protected static async thisShouldThrowBecauseIsStatic() {}
|
|
355
|
+
|
|
356
|
+
@test()
|
|
357
|
+
protected async afterEachCalledAOnSameInsntanceRUN_THIS_LAST() {
|
|
358
|
+
TestOnInstanceTest.instanceToCheckAfterEach = this
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
private assertResolvePathReturnsSameAsStatic(parts: string[]) {
|
|
362
|
+
const expected = AbstractModuleTest.resolvePath(...parts)
|
|
363
|
+
const actual = this.resolvePath(...parts)
|
|
364
|
+
|
|
365
|
+
assert.isEqual(actual, expected)
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
TestDecoratorResolver.onWillCallBeforeAll((Test) => {
|
|
370
|
+
willCallBeforeAllTest = Test
|
|
371
|
+
willCallBeforeAllCount++
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
TestDecoratorResolver.onWillCallBeforeAll(() => {
|
|
375
|
+
willCallBeforeAllCount2++
|
|
376
|
+
})
|
|
377
|
+
|
|
378
|
+
TestDecoratorResolver.onDidCallBeforeAll((Test) => {
|
|
379
|
+
didCallBeforeAllTest = Test
|
|
380
|
+
didCallBeforeAllCount++
|
|
381
|
+
})
|
|
382
|
+
|
|
383
|
+
TestDecoratorResolver.onDidCallBeforeAll(() => {
|
|
384
|
+
didCallBeforeAllCount2++
|
|
385
|
+
})
|
|
386
|
+
|
|
387
|
+
TestDecoratorResolver.onWillCallBeforeEach((Test) => {
|
|
388
|
+
willCallBeforeEachTest = Test
|
|
389
|
+
willCallBeforeEachCount++
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
TestDecoratorResolver.onWillCallBeforeEach(() => {
|
|
393
|
+
willCallBeforeEachCount2++
|
|
394
|
+
})
|
|
395
|
+
|
|
396
|
+
TestDecoratorResolver.onDidCallBeforeEach((Test) => {
|
|
397
|
+
didCallBeforeEachTest = Test
|
|
398
|
+
didCallBeforeEachCount++
|
|
399
|
+
})
|
|
400
|
+
|
|
401
|
+
TestDecoratorResolver.onDidCallBeforeEach(() => {
|
|
402
|
+
didCallBeforeEachCount2++
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
TestDecoratorResolver.onWillCallAfterEach((Test) => {
|
|
406
|
+
willCallAfterEachTest = Test
|
|
407
|
+
willCallAfterEachCount++
|
|
408
|
+
})
|
|
409
|
+
|
|
410
|
+
TestDecoratorResolver.onWillCallAfterEach(() => {
|
|
411
|
+
willCallAfterEachCount2++
|
|
412
|
+
})
|
|
413
|
+
|
|
414
|
+
TestDecoratorResolver.onDidCallAfterEach((Test) => {
|
|
415
|
+
didCallAfterEachTest = Test
|
|
416
|
+
didCallAfterEachCount++
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
TestDecoratorResolver.onDidCallAfterEach(() => {
|
|
420
|
+
didCallAfterEachCount2++
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
TestDecoratorResolver.onWillCallAfterAll((Test) => {
|
|
424
|
+
willCallAfterAllTest = Test
|
|
425
|
+
willCallAfterAllCount++
|
|
426
|
+
})
|
|
427
|
+
|
|
428
|
+
TestDecoratorResolver.onWillCallAfterAll(() => {
|
|
429
|
+
willCallAfterAllCount2++
|
|
430
|
+
})
|
|
431
|
+
|
|
432
|
+
TestDecoratorResolver.onDidCallAfterAll((Test) => {
|
|
433
|
+
didCallAfterAllCount++
|
|
434
|
+
didCallAfterAllTest = Test
|
|
435
|
+
})
|
|
436
|
+
|
|
437
|
+
TestDecoratorResolver.onDidCallAfterAll(() => {
|
|
438
|
+
didCallAfterAllCount2++
|
|
439
|
+
})
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import test, { suite } from '../../../utilities/decorators.js'
|
|
2
|
+
import assert from '../../../utilities/assert.js'
|
|
3
|
+
import AbstractTestOnInstanceTest from '../../support/AbstractTestOnInstanceTest.js'
|
|
4
|
+
import TestDecoratorResolver from '../../../utilities/TestDecoratorResolver.js'
|
|
5
|
+
|
|
6
|
+
@suite()
|
|
7
|
+
export default class TestOnInstanceExtendsTest extends AbstractTestOnInstanceTest {
|
|
8
|
+
protected static async beforeAll() {
|
|
9
|
+
assert.isEqual(
|
|
10
|
+
this.beforeBeforeAllCount,
|
|
11
|
+
1,
|
|
12
|
+
'beforeBeforeAll not called first'
|
|
13
|
+
)
|
|
14
|
+
assert.isEqual(
|
|
15
|
+
this.beforeBeforeAllCount2,
|
|
16
|
+
1,
|
|
17
|
+
'beforeBeforeAll not called second time'
|
|
18
|
+
)
|
|
19
|
+
assert.isEqual(
|
|
20
|
+
this.afterBeforeAllCount,
|
|
21
|
+
0,
|
|
22
|
+
'afterBeforeAll called too soon'
|
|
23
|
+
)
|
|
24
|
+
assert.isEqual(
|
|
25
|
+
this.afterBeforeAllCount2,
|
|
26
|
+
0,
|
|
27
|
+
'afterBeforeAll called too soon'
|
|
28
|
+
)
|
|
29
|
+
this.beforeAllCount += 1
|
|
30
|
+
|
|
31
|
+
assert.isEqual(this, TestOnInstanceExtendsTest)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
protected async beforeEach() {
|
|
35
|
+
TestOnInstanceExtendsTest.beforeEachCount += 1
|
|
36
|
+
|
|
37
|
+
assert.isEqual(
|
|
38
|
+
TestOnInstanceExtendsTest.beforeBeforeEach,
|
|
39
|
+
TestOnInstanceExtendsTest.beforeEachCount,
|
|
40
|
+
'beforeBeforeEach not called first'
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
assert.isEqual(
|
|
44
|
+
TestOnInstanceExtendsTest.beforeBeforeEach2,
|
|
45
|
+
TestOnInstanceExtendsTest.beforeEachCount,
|
|
46
|
+
'beforeBeforeEach not called second time'
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
assert.isEqual(
|
|
50
|
+
TestOnInstanceExtendsTest.afterBeforeEach,
|
|
51
|
+
TestOnInstanceExtendsTest.beforeEachCount - 1,
|
|
52
|
+
'afterBeforeEach called too soon'
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
assert.isEqual(
|
|
56
|
+
TestOnInstanceExtendsTest.afterBeforeEach2,
|
|
57
|
+
TestOnInstanceExtendsTest.beforeEachCount - 1,
|
|
58
|
+
'afterBeforeEach called too soon'
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
assert.isInstanceOf(this, TestOnInstanceExtendsTest)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected async afterEach() {
|
|
65
|
+
TestOnInstanceExtendsTest.afterEachCount += 1
|
|
66
|
+
|
|
67
|
+
assert.isEqual(
|
|
68
|
+
TestOnInstanceExtendsTest.beforeAfterEach,
|
|
69
|
+
TestOnInstanceExtendsTest.afterEachCount,
|
|
70
|
+
'beforeAfterEach not called first'
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
assert.isEqual(
|
|
74
|
+
TestOnInstanceExtendsTest.beforeAfterEach2,
|
|
75
|
+
TestOnInstanceExtendsTest.afterEachCount,
|
|
76
|
+
'beforeAfterEach not called second time'
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
assert.isEqual(
|
|
80
|
+
TestOnInstanceExtendsTest.afterAfterEach,
|
|
81
|
+
TestOnInstanceExtendsTest.afterEachCount - 1,
|
|
82
|
+
'afterAfterEach called too soon'
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
assert.isEqual(
|
|
86
|
+
TestOnInstanceExtendsTest.afterAfterEach2,
|
|
87
|
+
TestOnInstanceExtendsTest.afterEachCount - 1,
|
|
88
|
+
'afterAfterEach called too soon'
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
assert.isEqual(
|
|
92
|
+
TestOnInstanceExtendsTest.beforeAfterAll,
|
|
93
|
+
0,
|
|
94
|
+
'beforeAfterAll called too soon'
|
|
95
|
+
)
|
|
96
|
+
assert.isEqual(
|
|
97
|
+
TestOnInstanceExtendsTest.beforeAfterAll2,
|
|
98
|
+
0,
|
|
99
|
+
'beforeAfterAll called too soon'
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
assert.isInstanceOf(this, TestOnInstanceExtendsTest)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
protected static async afterAll() {
|
|
106
|
+
assert.isEqual(
|
|
107
|
+
TestOnInstanceExtendsTest.beforeAllCount,
|
|
108
|
+
1,
|
|
109
|
+
'beforeAll not called once'
|
|
110
|
+
)
|
|
111
|
+
assert.isEqual(
|
|
112
|
+
TestOnInstanceExtendsTest.afterBeforeAllCount,
|
|
113
|
+
1,
|
|
114
|
+
'afterBeforeAll not called first'
|
|
115
|
+
)
|
|
116
|
+
assert.isEqual(
|
|
117
|
+
TestOnInstanceExtendsTest.afterBeforeAllCount2,
|
|
118
|
+
1,
|
|
119
|
+
'afterBeforeAll not called second time'
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
assert.isEqual(
|
|
123
|
+
TestOnInstanceExtendsTest.beforeAfterAll,
|
|
124
|
+
1,
|
|
125
|
+
'beforeAfterAll was not called'
|
|
126
|
+
)
|
|
127
|
+
assert.isEqual(
|
|
128
|
+
TestOnInstanceExtendsTest.beforeAfterAll2,
|
|
129
|
+
1,
|
|
130
|
+
'beforeAfterAll was not called'
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
assert.isEqual(this, TestOnInstanceExtendsTest)
|
|
134
|
+
|
|
135
|
+
assert.isEqual(
|
|
136
|
+
TestOnInstanceExtendsTest.afterAfterAll,
|
|
137
|
+
0,
|
|
138
|
+
'afterAfterAll called too soon'
|
|
139
|
+
)
|
|
140
|
+
assert.isEqual(
|
|
141
|
+
TestOnInstanceExtendsTest.afterAfterAll2,
|
|
142
|
+
0,
|
|
143
|
+
'afterAfterAll called too soon'
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
assert.isEqual(
|
|
148
|
+
TestOnInstanceExtendsTest.afterAfterAll,
|
|
149
|
+
1,
|
|
150
|
+
'afterAfterAll not called'
|
|
151
|
+
)
|
|
152
|
+
assert.isEqual(
|
|
153
|
+
TestOnInstanceExtendsTest.afterAfterAll2,
|
|
154
|
+
1,
|
|
155
|
+
'afterAfterAll not called'
|
|
156
|
+
)
|
|
157
|
+
}, 10)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@test()
|
|
161
|
+
protected async doesCallBeforeAll() {
|
|
162
|
+
assert.isEqual(
|
|
163
|
+
TestOnInstanceExtendsTest.beforeAllCount,
|
|
164
|
+
1,
|
|
165
|
+
'Did not call beforeAll'
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@test()
|
|
170
|
+
protected async basicPassingTest() {
|
|
171
|
+
assert.isTrue(true)
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
TestDecoratorResolver.onWillCallBeforeAll(() => {
|
|
176
|
+
TestOnInstanceExtendsTest.beforeBeforeAllCount++
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
TestDecoratorResolver.onWillCallBeforeAll(() => {
|
|
180
|
+
TestOnInstanceExtendsTest.beforeBeforeAllCount2++
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
TestDecoratorResolver.onDidCallBeforeAll(() => {
|
|
184
|
+
TestOnInstanceExtendsTest.afterBeforeAllCount++
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
TestDecoratorResolver.onDidCallBeforeAll(() => {
|
|
188
|
+
TestOnInstanceExtendsTest.afterBeforeAllCount2++
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
TestDecoratorResolver.onWillCallBeforeEach(() => {
|
|
192
|
+
TestOnInstanceExtendsTest.beforeBeforeEach++
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
TestDecoratorResolver.onWillCallBeforeEach(() => {
|
|
196
|
+
TestOnInstanceExtendsTest.beforeBeforeEach2++
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
TestDecoratorResolver.onDidCallBeforeEach(() => {
|
|
200
|
+
TestOnInstanceExtendsTest.afterBeforeEach++
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
TestDecoratorResolver.onDidCallBeforeEach(() => {
|
|
204
|
+
TestOnInstanceExtendsTest.afterBeforeEach2++
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
TestDecoratorResolver.onWillCallAfterEach(() => {
|
|
208
|
+
TestOnInstanceExtendsTest.beforeAfterEach++
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
TestDecoratorResolver.onWillCallAfterEach(() => {
|
|
212
|
+
TestOnInstanceExtendsTest.beforeAfterEach2++
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
TestDecoratorResolver.onDidCallAfterEach(() => {
|
|
216
|
+
TestOnInstanceExtendsTest.afterAfterEach++
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
TestDecoratorResolver.onDidCallAfterEach(() => {
|
|
220
|
+
TestOnInstanceExtendsTest.afterAfterEach2++
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
TestDecoratorResolver.onWillCallAfterAll(() => {
|
|
224
|
+
TestOnInstanceExtendsTest.beforeAfterAll++
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
TestDecoratorResolver.onWillCallAfterAll(() => {
|
|
228
|
+
TestOnInstanceExtendsTest.beforeAfterAll2++
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
TestDecoratorResolver.onDidCallAfterAll(() => {
|
|
232
|
+
TestOnInstanceExtendsTest.afterAfterAll++
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
TestDecoratorResolver.onDidCallAfterAll(() => {
|
|
236
|
+
TestOnInstanceExtendsTest.afterAfterAll2++
|
|
237
|
+
})
|