@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,23 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var InstanceParentTestCanAccessParentMethodsTest_1;
|
|
8
|
+
import assert from '../../../utilities/assert.js';
|
|
9
|
+
import test, { suite } from '../../../utilities/decorators.js';
|
|
10
|
+
import AbstractStaticTest from '../../support/AbstractStaticTest.js';
|
|
11
|
+
let InstanceParentTestCanAccessParentMethodsTest = InstanceParentTestCanAccessParentMethodsTest_1 = class InstanceParentTestCanAccessParentMethodsTest extends AbstractStaticTest {
|
|
12
|
+
async canCreateInstanceParentTestCanAccessParentMethods() {
|
|
13
|
+
assert.isTrue(InstanceParentTestCanAccessParentMethodsTest_1.didCallAnotherStaticMethodInBeforeEach, 'beforeAll in parent class not referrenced');
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
test()
|
|
18
|
+
], InstanceParentTestCanAccessParentMethodsTest.prototype, "canCreateInstanceParentTestCanAccessParentMethods", null);
|
|
19
|
+
InstanceParentTestCanAccessParentMethodsTest = InstanceParentTestCanAccessParentMethodsTest_1 = __decorate([
|
|
20
|
+
suite()
|
|
21
|
+
], InstanceParentTestCanAccessParentMethodsTest);
|
|
22
|
+
export default InstanceParentTestCanAccessParentMethodsTest;
|
|
23
|
+
//# sourceMappingURL=InstanceParentTestCanAccessParentMethods.test.js.map
|
package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstanceParentTestCanAccessParentMethods.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AAGrD,IAAM,4CAA4C,oDAAlD,MAAM,4CAA6C,SAAQ,kBAAkB;IAExE,AAAN,KAAK,CAAC,iDAAiD;QAC7D,MAAM,CAAC,MAAM,CACT,8CAA4C,CAAC,sCAAsC,EACnF,2CAA2C,CAC9C,CAAA;IACL,CAAC;CACJ,CAAA;AANmB;IADf,IAAI,EAAE;qHAMN;AAPgB,4CAA4C;IADhE,KAAK,EAAE;GACa,4CAA4C,CAQhE;eARoB,4CAA4C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
|
|
2
|
+
export default class MockFetchTest extends AbstractModuleTest {
|
|
3
|
+
private mock;
|
|
4
|
+
private fetch;
|
|
5
|
+
private url;
|
|
6
|
+
protected throwsIfNotCalled(): Promise<void>;
|
|
7
|
+
protected passesIfCalled(): Promise<void>;
|
|
8
|
+
protected throwsIfUrlDoesNotMatch(): Promise<void>;
|
|
9
|
+
protected canAssertMultipleCalls(): Promise<void>;
|
|
10
|
+
protected assertMultipleFailsIfSecondUrlDoesNotMatch(): Promise<void>;
|
|
11
|
+
protected assertCalledThrowsIfDoesNotMatchSecondUrl(): Promise<void>;
|
|
12
|
+
protected throwsIfInitDoesNotMatch(): Promise<void>;
|
|
13
|
+
protected passesIfMethodMatches(): Promise<void>;
|
|
14
|
+
protected passesIfHeadersMatch(): Promise<void>;
|
|
15
|
+
protected throwsIfHeadersDoNotMatch(): Promise<void>;
|
|
16
|
+
protected doesNotThrowIfMultipleRequestsMatch(): Promise<void>;
|
|
17
|
+
protected getBackGeneric200Response(): Promise<void>;
|
|
18
|
+
protected canSetResponseForAllRequests(): Promise<void>;
|
|
19
|
+
protected defaultResponseDoesNotThrowWhenGettingJson(): Promise<void>;
|
|
20
|
+
protected canSetResponseByUrl(): Promise<void>;
|
|
21
|
+
protected canSetResponseByInit(): Promise<void>;
|
|
22
|
+
private setResponse;
|
|
23
|
+
private assertFetchResponseEquals;
|
|
24
|
+
private assertMadeRequests;
|
|
25
|
+
private randomizeUrl;
|
|
26
|
+
private callFetch;
|
|
27
|
+
private assertFetchWasCalled;
|
|
28
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import generateId from '@neurodevs/generate-id';
|
|
8
|
+
import assert from '../../../utilities/assert.js';
|
|
9
|
+
import test, { suite } from '../../../utilities/decorators.js';
|
|
10
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
|
|
11
|
+
import MockFetch from '../../MockFetch.js';
|
|
12
|
+
let MockFetchTest = class MockFetchTest extends AbstractModuleTest {
|
|
13
|
+
mock = new MockFetch();
|
|
14
|
+
fetch = this.mock.buildFetch();
|
|
15
|
+
url = generateId();
|
|
16
|
+
async throwsIfNotCalled() {
|
|
17
|
+
assert.doesThrow(() => this.assertFetchWasCalled(), 'expected');
|
|
18
|
+
}
|
|
19
|
+
async passesIfCalled() {
|
|
20
|
+
await this.callFetch();
|
|
21
|
+
this.assertFetchWasCalled();
|
|
22
|
+
}
|
|
23
|
+
async throwsIfUrlDoesNotMatch() {
|
|
24
|
+
await this.callFetch();
|
|
25
|
+
assert.doesThrow(() => this.assertFetchWasCalled(generateId()), 'Expected fetch() to have been called with URL');
|
|
26
|
+
}
|
|
27
|
+
async canAssertMultipleCalls() {
|
|
28
|
+
await this.callFetch();
|
|
29
|
+
const url1 = this.url;
|
|
30
|
+
this.randomizeUrl();
|
|
31
|
+
await this.callFetch();
|
|
32
|
+
const expected = [url1, this.url];
|
|
33
|
+
this.assertMadeRequests(expected);
|
|
34
|
+
}
|
|
35
|
+
async assertMultipleFailsIfSecondUrlDoesNotMatch() {
|
|
36
|
+
await this.callFetch();
|
|
37
|
+
const url1 = this.url;
|
|
38
|
+
this.randomizeUrl();
|
|
39
|
+
await this.callFetch();
|
|
40
|
+
const expected = [url1, generateId()];
|
|
41
|
+
assert.doesThrow(() => this.assertMadeRequests(expected), 'Expected fetch() to have been called with URL');
|
|
42
|
+
}
|
|
43
|
+
async assertCalledThrowsIfDoesNotMatchSecondUrl() {
|
|
44
|
+
await this.callFetch();
|
|
45
|
+
const url = this.url;
|
|
46
|
+
this.randomizeUrl();
|
|
47
|
+
await this.callFetch();
|
|
48
|
+
assert.doesThrow(() => this.assertFetchWasCalled(url), 'Expected fetch() to have been called with URL');
|
|
49
|
+
}
|
|
50
|
+
async throwsIfInitDoesNotMatch() {
|
|
51
|
+
await this.callFetch({
|
|
52
|
+
method: 'POST',
|
|
53
|
+
});
|
|
54
|
+
assert.doesThrow(() => this.assertFetchWasCalled(this.url, {
|
|
55
|
+
method: 'GET',
|
|
56
|
+
}), 'Expected fetch() to have been called with init');
|
|
57
|
+
}
|
|
58
|
+
async passesIfMethodMatches() {
|
|
59
|
+
await this.callFetch({
|
|
60
|
+
method: 'POST',
|
|
61
|
+
});
|
|
62
|
+
this.assertFetchWasCalled(this.url, {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async passesIfHeadersMatch() {
|
|
67
|
+
await this.callFetch({
|
|
68
|
+
headers: {
|
|
69
|
+
'Content-Type': 'application/json',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
this.assertFetchWasCalled(this.url, {
|
|
73
|
+
headers: {
|
|
74
|
+
'Content-Type': 'application/json',
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async throwsIfHeadersDoNotMatch() {
|
|
79
|
+
await this.callFetch({
|
|
80
|
+
headers: {
|
|
81
|
+
'Content-Type': 'application/json',
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
assert.doesThrow(() => this.assertFetchWasCalled(this.url, {
|
|
85
|
+
headers: {
|
|
86
|
+
'Content-Type': 'text/plain',
|
|
87
|
+
},
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
async doesNotThrowIfMultipleRequestsMatch() {
|
|
91
|
+
await this.callFetch({
|
|
92
|
+
method: 'POST',
|
|
93
|
+
});
|
|
94
|
+
await this.callFetch({
|
|
95
|
+
method: 'GET',
|
|
96
|
+
});
|
|
97
|
+
this.assertMadeRequests([
|
|
98
|
+
{ url: this.url, init: { method: 'POST' } },
|
|
99
|
+
{ url: this.url, init: { method: 'GET' } },
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
async getBackGeneric200Response() {
|
|
103
|
+
const expected = new Response(JSON.stringify({
|
|
104
|
+
success: true,
|
|
105
|
+
}), { status: 200 });
|
|
106
|
+
await this.assertFetchResponseEquals(expected);
|
|
107
|
+
}
|
|
108
|
+
async canSetResponseForAllRequests() {
|
|
109
|
+
const expected = new Response('Hello, World!', {
|
|
110
|
+
status: 404,
|
|
111
|
+
});
|
|
112
|
+
this.setResponse(expected);
|
|
113
|
+
await this.assertFetchResponseEquals(expected);
|
|
114
|
+
}
|
|
115
|
+
async defaultResponseDoesNotThrowWhenGettingJson() {
|
|
116
|
+
const response = await this.callFetch();
|
|
117
|
+
await response.json();
|
|
118
|
+
}
|
|
119
|
+
async canSetResponseByUrl() {
|
|
120
|
+
const expected1 = new Response('Response for URL 1', {});
|
|
121
|
+
const expected2 = new Response('Response for URL 2', {});
|
|
122
|
+
const url1 = generateId();
|
|
123
|
+
const url2 = generateId();
|
|
124
|
+
this.setResponse(expected1, url1);
|
|
125
|
+
this.setResponse(expected2, url2);
|
|
126
|
+
this.url = url1;
|
|
127
|
+
await this.assertFetchResponseEquals(expected1);
|
|
128
|
+
this.url = url2;
|
|
129
|
+
await this.assertFetchResponseEquals(expected2);
|
|
130
|
+
}
|
|
131
|
+
async canSetResponseByInit() {
|
|
132
|
+
const expected1 = new Response('Special POST Response 1', {});
|
|
133
|
+
const expected2 = new Response('Special POST Response 2', {});
|
|
134
|
+
this.setResponse(expected1, this.url, { method: 'POST' });
|
|
135
|
+
this.setResponse(expected2, this.url, { method: 'GET' });
|
|
136
|
+
await this.assertFetchResponseEquals(expected1, { method: 'POST' });
|
|
137
|
+
await this.assertFetchResponseEquals(expected2, { method: 'GET' });
|
|
138
|
+
}
|
|
139
|
+
setResponse(expected, url, init) {
|
|
140
|
+
this.mock.setResponse(expected, url, init);
|
|
141
|
+
}
|
|
142
|
+
async assertFetchResponseEquals(expected, init) {
|
|
143
|
+
const response = await this.callFetch(init);
|
|
144
|
+
assert.isEqualDeep((await response.text()) + ': ' + response.status, (await expected.text()) + ': ' + expected.status, 'fetch() did not return the expected response.');
|
|
145
|
+
}
|
|
146
|
+
assertMadeRequests(expected) {
|
|
147
|
+
this.mock.assertMadeRequests(expected);
|
|
148
|
+
}
|
|
149
|
+
randomizeUrl() {
|
|
150
|
+
this.url = generateId();
|
|
151
|
+
}
|
|
152
|
+
async callFetch(init) {
|
|
153
|
+
return await this.fetch(this.url, init);
|
|
154
|
+
}
|
|
155
|
+
assertFetchWasCalled(url, init) {
|
|
156
|
+
this.mock.assertWasCalled(url, init);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
__decorate([
|
|
160
|
+
test()
|
|
161
|
+
], MockFetchTest.prototype, "throwsIfNotCalled", null);
|
|
162
|
+
__decorate([
|
|
163
|
+
test()
|
|
164
|
+
], MockFetchTest.prototype, "passesIfCalled", null);
|
|
165
|
+
__decorate([
|
|
166
|
+
test()
|
|
167
|
+
], MockFetchTest.prototype, "throwsIfUrlDoesNotMatch", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
test()
|
|
170
|
+
], MockFetchTest.prototype, "canAssertMultipleCalls", null);
|
|
171
|
+
__decorate([
|
|
172
|
+
test()
|
|
173
|
+
], MockFetchTest.prototype, "assertMultipleFailsIfSecondUrlDoesNotMatch", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
test()
|
|
176
|
+
], MockFetchTest.prototype, "assertCalledThrowsIfDoesNotMatchSecondUrl", null);
|
|
177
|
+
__decorate([
|
|
178
|
+
test()
|
|
179
|
+
], MockFetchTest.prototype, "throwsIfInitDoesNotMatch", null);
|
|
180
|
+
__decorate([
|
|
181
|
+
test()
|
|
182
|
+
], MockFetchTest.prototype, "passesIfMethodMatches", null);
|
|
183
|
+
__decorate([
|
|
184
|
+
test()
|
|
185
|
+
], MockFetchTest.prototype, "passesIfHeadersMatch", null);
|
|
186
|
+
__decorate([
|
|
187
|
+
test()
|
|
188
|
+
], MockFetchTest.prototype, "throwsIfHeadersDoNotMatch", null);
|
|
189
|
+
__decorate([
|
|
190
|
+
test()
|
|
191
|
+
], MockFetchTest.prototype, "doesNotThrowIfMultipleRequestsMatch", null);
|
|
192
|
+
__decorate([
|
|
193
|
+
test()
|
|
194
|
+
], MockFetchTest.prototype, "getBackGeneric200Response", null);
|
|
195
|
+
__decorate([
|
|
196
|
+
test()
|
|
197
|
+
], MockFetchTest.prototype, "canSetResponseForAllRequests", null);
|
|
198
|
+
__decorate([
|
|
199
|
+
test()
|
|
200
|
+
], MockFetchTest.prototype, "defaultResponseDoesNotThrowWhenGettingJson", null);
|
|
201
|
+
__decorate([
|
|
202
|
+
test()
|
|
203
|
+
], MockFetchTest.prototype, "canSetResponseByUrl", null);
|
|
204
|
+
__decorate([
|
|
205
|
+
test()
|
|
206
|
+
], MockFetchTest.prototype, "canSetResponseByInit", null);
|
|
207
|
+
MockFetchTest = __decorate([
|
|
208
|
+
suite()
|
|
209
|
+
], MockFetchTest);
|
|
210
|
+
export default MockFetchTest;
|
|
211
|
+
//# sourceMappingURL=MockFetch.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockFetch.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/MockFetch.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAE/C,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AACpE,OAAO,SAA8B,MA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N;AAGe;IADf,IAAI,EAAE;4DAON;AAGe;IADf,IAAI,EAAE;2DAUN;AAGe;IADf,IAAI,EAAE;+EAaN;AAGe;IADf,IAAI,EAAE;8EAWN;AAGe;IADf,IAAI,EAAE;6DAaN;AAGe;IADf,IAAI,EAAE;0DASN;AAGe;IADf,IAAI,EAAE;yDAaN;AAGe;IADf,IAAI,EAAE;8DAeN;AAGe;IADf,IAAI,EAAE;wEAcN;AAGe;IADf,IAAI,EAAE;8DASN;AAGe;IADf,IAAI,EAAE;iEAQN;AAGe;IADf,IAAI,EAAE;+EAIN;AAGe;IADf,IAAI,EAAE;wDAgBN;AAGe;IADf,IAAI,EAAE;yDAUN;AAlMgB,aAAa;IADjC,KAAK,EAAE;GACa,aAAa,CAuOjC;eAvOoB,aAAa"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
|
|
8
|
+
import assert from '../../../utilities/assert.js';
|
|
9
|
+
import test from '../../../utilities/decorators.js';
|
|
10
|
+
import StackCleaner from '../../../utilities/StackCleaner.js';
|
|
11
|
+
export default class ErrorStackTest extends AbstractModuleTest {
|
|
12
|
+
static async removesExpected(stack, expected) {
|
|
13
|
+
const cleaned = StackCleaner.clean(stack);
|
|
14
|
+
assert.isEqual(cleaned, expected);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
test('removes test files', `Error: You called will-fail!
|
|
19
|
+
at Object.willFail (~/node-tdd/src/assert.ts:53:17)
|
|
20
|
+
at Function.canRemoveTestFiles (~/node-tdd/src/__tests__/ErrorStack.test.ts:8:10)
|
|
21
|
+
at Object.<anonymous> (~/node-tdd/src/decorators.ts:36:11)
|
|
22
|
+
at Object.asyncJestTest (~/node-tdd/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:100:37)
|
|
23
|
+
at ~/node-tdd/node_modules/jest-jasmine2/build/queueRunner.js:45:12
|
|
24
|
+
at new Promise (<anonymous>)
|
|
25
|
+
at mapper (~/node-tdd/node_modules/jest-jasmine2/build/queueRunner.js:28:19)
|
|
26
|
+
at ~/node-tdd/node_modules/jest-jasmine2/build/queueRunner.js:75:41
|
|
27
|
+
at processTicksAndRejections (internal/process/task_queues.js:97:5)`, `Error: You called will-fail!
|
|
28
|
+
at Function.canRemoveTestFiles (~/node-tdd/src/__tests__/ErrorStack.test.ts:8:10)
|
|
29
|
+
at new Promise (<anonymous>)`),
|
|
30
|
+
test('drops babel crap', `TypeError: Cannot read property 'map' of undefined
|
|
31
|
+
at Object (~/example/src/databases/mongo.utilities.ts:21:17)
|
|
32
|
+
at Array.forEach (<anonymous>)
|
|
33
|
+
at mapNestedIdValues (~/example/src/databases/mongo.utilities.ts:20:2)
|
|
34
|
+
at Object.mongoUtil [as mapQuery] (~/example/src/databases/mongo.utilities.ts:11:27)
|
|
35
|
+
at MongoDatabase.toMongo…
|
|
36
|
+
at Generator.next (~/example/node_modules/regenerator-runtime/runtime.js:118:21)
|
|
37
|
+
at asyncGeneratorStep (~/example/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
|
|
38
|
+
at _next (~/example/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
|
|
39
|
+
at processTicksAndRejections (internal/process/task_queues.js:97:5)`, `TypeError: Cannot read property 'map' of undefined
|
|
40
|
+
at Object (~/example/src/databases/mongo.utilities.ts:21:17)
|
|
41
|
+
at Array.forEach (<anonymous>)
|
|
42
|
+
at mapNestedIdValues (~/example/src/databases/mongo.utilities.ts:20:2)
|
|
43
|
+
at Object.mongoUtil [as mapQuery] (~/example/src/databases/mongo.utilities.ts:11:27)
|
|
44
|
+
at MongoDatabase.toMongo…`)
|
|
45
|
+
], ErrorStackTest, "removesExpected", null);
|
|
46
|
+
//# sourceMappingURL=StackCleaner.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StackCleaner.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/StackCleaner.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AACpE,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,MAAM,kCAAkC,CAAA;AACnD,OAAO,YAAY,MAAM,oCAAoC,CAAA;AAE7D,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,kBAAkB;IAoCnC,AAAb,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,KAAa,EAAE,QAAgB;QAClE,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACzC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;CACJ;AAJ0B;IAnCtB,IAAI,CACD,oBAAoB,EACpB;;;;;;;;;qEAS6D,EAC7D;;8BAEsB,CACzB;IACA,IAAI,CACD,kBAAkB,EAClB;;;;;;;;;wEASgE,EAChE;;;;;8BAKsB,CACzB;2CAIA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import AbstractStaticTest from '../../support/AbstractStaticTest.js';
|
|
2
|
+
export default class StaticParentTestCanAccessParentMethodsTest extends AbstractStaticTest {
|
|
3
|
+
protected static didCallFirstTest: boolean;
|
|
4
|
+
protected static afterAll(): Promise<void>;
|
|
5
|
+
protected static didCallBeforeAllScopedCorrectly(): Promise<void>;
|
|
6
|
+
protected static shouldCallFirstTest(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import assert from '../../../utilities/assert.js';
|
|
8
|
+
import test from '../../../utilities/decorators.js';
|
|
9
|
+
import AbstractStaticTest from '../../support/AbstractStaticTest.js';
|
|
10
|
+
export default class StaticParentTestCanAccessParentMethodsTest extends AbstractStaticTest {
|
|
11
|
+
static didCallFirstTest = false;
|
|
12
|
+
static async afterAll() {
|
|
13
|
+
await super.afterAll();
|
|
14
|
+
assert.isEqual(this, StaticParentTestCanAccessParentMethodsTest);
|
|
15
|
+
assert.isTrue(this.didCallAnotherStaticMethodInBeforeEach, 'beforeAll in parent class not referrenced');
|
|
16
|
+
assert.isTrue(this.didCallFirstTest, 'First test was not called');
|
|
17
|
+
}
|
|
18
|
+
static async didCallBeforeAllScopedCorrectly() {
|
|
19
|
+
this.didCallFirstTest = true;
|
|
20
|
+
assert.isTrue(this.didCallAnotherStaticMethodInBeforeEach, 'beforeAll in parent class not referrenced');
|
|
21
|
+
}
|
|
22
|
+
static async shouldCallFirstTest() {
|
|
23
|
+
assert.isTrue(this.didCallFirstTest, 'First test was not called');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
__decorate([
|
|
27
|
+
test()
|
|
28
|
+
], StaticParentTestCanAccessParentMethodsTest, "didCallBeforeAllScopedCorrectly", null);
|
|
29
|
+
__decorate([
|
|
30
|
+
test()
|
|
31
|
+
], StaticParentTestCanAccessParentMethodsTest, "shouldCallFirstTest", null);
|
|
32
|
+
//# sourceMappingURL=StaticParentTestCanAccessParentMethods.test.js.map
|
package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StaticParentTestCanAccessParentMethods.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,MAAM,kCAAkC,CAAA;AACnD,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AAEpE,MAAM,CAAC,OAAO,OAAO,0CAA2C,SAAQ,kBAAkB;IAC5E,MAAM,CAAC,gBAAgB,GAAG,KAAK,CAAA;IAE/B,MAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAA;QAEtB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,0CAA0C,CAAC,CAAA;QAEhE,MAAM,CAAC,MAAM,CACT,IAAI,CAAC,sCAAsC,EAC3C,2CAA2C,CAC9C,CAAA;QAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAA;IACrE,CAAC;IAGsB,AAAb,MAAM,CAAC,KAAK,CAAC,+BAA+B;QAClD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAA;QAC5B,MAAM,CAAC,MAAM,CACT,IAAI,CAAC,sCAAsC,EAC3C,2CAA2C,CAC9C,CAAA;IACL,CAAC;IAGsB,AAAb,MAAM,CAAC,KAAK,CAAC,mBAAmB;QACtC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAA;IACrE,CAAC;;AAXsB;IADtB,IAAI,EAAE;uFAON;AAGsB;IADtB,IAAI,EAAE;2EAGN"}
|
package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
|
|
8
|
+
import assert from '../../../utilities/assert.js';
|
|
9
|
+
import test from '../../../utilities/decorators.js';
|
|
10
|
+
export default class StaticTestInheritsAbstractModuleTestProperlyTest extends AbstractModuleTest {
|
|
11
|
+
static canCreateStaticTestInheritsAbstractModuleTestProperly() {
|
|
12
|
+
assert.isEqual(this.cwd, process.cwd());
|
|
13
|
+
this.resolvePath('hello');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
__decorate([
|
|
17
|
+
test('checking if cwd is set')
|
|
18
|
+
], StaticTestInheritsAbstractModuleTestProperlyTest, "canCreateStaticTestInheritsAbstractModuleTestProperly", null);
|
|
19
|
+
//# sourceMappingURL=StaticTestInheritsAbstractSpruceTestProperly.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StaticTestInheritsAbstractSpruceTestProperly.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AACpE,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,MAAM,kCAAkC,CAAA;AAEnD,MAAM,CAAC,OAAO,OAAO,gDAAiD,SAAQ,kBAAkB;IAE3E,AAAP,MAAM,CAAC,qDAAqD;QAClE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACvC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IAC7B,CAAC;CACJ;AAJoB;IADhB,IAAI,CAAC,wBAAwB,CAAC;mHAI9B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default class StringifyTest {
|
|
2
|
+
protected static dropInPlaceholders(obj: any, expected: any): void;
|
|
3
|
+
protected static printsPlaceholderFields(obj: Record<string, any>, expected: string): void;
|
|
4
|
+
protected static canRenderWithoutStrippingCharactorsInTestReporter(obj: any): void;
|
|
5
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import assert from '../../../utilities/assert.js';
|
|
9
|
+
import test from '../../../utilities/decorators.js';
|
|
10
|
+
import assertUtil, { CIRCULAR_PLACEHOLDER, FUNCTION_PLACEHOLDER, NULL_PLACEHOLDER, UNDEFINED_PLACEHOLDER, } from '../../../utilities/assert.utility.js';
|
|
11
|
+
const teammate = {
|
|
12
|
+
firstName: 'tay',
|
|
13
|
+
};
|
|
14
|
+
const team = {
|
|
15
|
+
teammate: { ...teammate },
|
|
16
|
+
};
|
|
17
|
+
team.teammate.team = team;
|
|
18
|
+
const team2 = {
|
|
19
|
+
teammate,
|
|
20
|
+
teammate2: teammate,
|
|
21
|
+
};
|
|
22
|
+
const team3 = {
|
|
23
|
+
teammate: {
|
|
24
|
+
...teammate,
|
|
25
|
+
age: 100,
|
|
26
|
+
},
|
|
27
|
+
coach: {
|
|
28
|
+
name: {
|
|
29
|
+
firstName: 'tay',
|
|
30
|
+
age: 100,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default class StringifyTest {
|
|
35
|
+
static dropInPlaceholders(obj, expected) {
|
|
36
|
+
const placholder = assertUtil.dropInPlaceholders(obj);
|
|
37
|
+
assert.isEqualDeep(placholder, expected);
|
|
38
|
+
}
|
|
39
|
+
static printsPlaceholderFields(obj, expected) {
|
|
40
|
+
const stringified = assertUtil.stringify(obj);
|
|
41
|
+
assert.isEqual(stringified, chalk.bold(assertUtil.replacePlaceholders(expected)));
|
|
42
|
+
}
|
|
43
|
+
static canRenderWithoutStrippingCharactorsInTestReporter(obj) {
|
|
44
|
+
process.stderr.write(assertUtil.stringify(obj));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
__decorate([
|
|
48
|
+
test('placeholdering simple object', { test: true }, { test: true }),
|
|
49
|
+
test('placeholdering object with null', { test: null }, { test: NULL_PLACEHOLDER }),
|
|
50
|
+
test('placeholdering object with function', { test: () => { } }, { test: FUNCTION_PLACEHOLDER }),
|
|
51
|
+
test('placeholdering circular object', team, {
|
|
52
|
+
teammate: {
|
|
53
|
+
firstName: 'tay',
|
|
54
|
+
team: CIRCULAR_PLACEHOLDER,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
test('placeholdering same object on same level', team2, {
|
|
58
|
+
teammate: {
|
|
59
|
+
firstName: 'tay',
|
|
60
|
+
},
|
|
61
|
+
teammate2: {
|
|
62
|
+
firstName: 'tay',
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
test('placeholdering objects with same values at different levels', team3, {
|
|
66
|
+
teammate: {
|
|
67
|
+
firstName: 'tay',
|
|
68
|
+
age: 100,
|
|
69
|
+
},
|
|
70
|
+
coach: {
|
|
71
|
+
name: {
|
|
72
|
+
firstName: 'tay',
|
|
73
|
+
age: 100,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
})
|
|
77
|
+
], StringifyTest, "dropInPlaceholders", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
test('one level deep (undefined)', {
|
|
80
|
+
hello: 'world',
|
|
81
|
+
undefined,
|
|
82
|
+
}, `{
|
|
83
|
+
"hello": "world",
|
|
84
|
+
"undefined": "${UNDEFINED_PLACEHOLDER}"
|
|
85
|
+
}`),
|
|
86
|
+
test('one level deep (null)', {
|
|
87
|
+
hello: 'world',
|
|
88
|
+
null: null,
|
|
89
|
+
}, `{
|
|
90
|
+
"hello": "world",
|
|
91
|
+
"null": "${NULL_PLACEHOLDER}"
|
|
92
|
+
}`),
|
|
93
|
+
test('two levels deep', {
|
|
94
|
+
hello: 'world',
|
|
95
|
+
undefinedDeep: {
|
|
96
|
+
undefined,
|
|
97
|
+
},
|
|
98
|
+
}, `{
|
|
99
|
+
"hello": "world",
|
|
100
|
+
"undefinedDeep": {
|
|
101
|
+
"undefined": "${UNDEFINED_PLACEHOLDER}"
|
|
102
|
+
}
|
|
103
|
+
}`),
|
|
104
|
+
test('three levels deep', {
|
|
105
|
+
hello: 'world',
|
|
106
|
+
undefinedDeep: {
|
|
107
|
+
undefinedDeepAgain: {
|
|
108
|
+
undefined,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
}, `{
|
|
112
|
+
"hello": "world",
|
|
113
|
+
"undefinedDeep": {
|
|
114
|
+
"undefinedDeepAgain": {
|
|
115
|
+
"undefined": "${UNDEFINED_PLACEHOLDER}"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}`),
|
|
119
|
+
test('prints a function nicely', { hello: () => { } }, `{
|
|
120
|
+
"hello": "${FUNCTION_PLACEHOLDER}"
|
|
121
|
+
}`)
|
|
122
|
+
], StringifyTest, "printsPlaceholderFields", null);
|
|
123
|
+
__decorate([
|
|
124
|
+
test.skip('array looks good', ['hello', 'world']),
|
|
125
|
+
test.skip('objects looks good', { hello: 'world' })
|
|
126
|
+
], StringifyTest, "canRenderWithoutStrippingCharactorsInTestReporter", null);
|
|
127
|
+
//# sourceMappingURL=Stringify.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stringify.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/Stringify.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,MAAM,kCAAkC,CAAA;AACnD,OAAO,UAAU,EAAE,EACf,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACxB,MAAM,sCAAsC,CAAA;AAE7C,MAAM,QAAQ,GAAG;IACb,SAAS,EAAE,KAAK;CACnB,CAAA;AAED,MAAM,IAAI,GAAwB;IAC9B,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE;CAC5B,CAAA;AAED,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAA;AAEzB,MAAM,KAAK,GAAG;IACV,QAAQ;IACR,SAAS,EAAE,QAAQ;CACtB,CAAA;AAED,MAAM,KAAK,GAAG;IACV,QAAQ,EAAE;QACN,GAAG,QAAQ;QACX,GAAG,EAAE,GAAG;KACX;IACD,KAAK,EAAE;QACH,IAAI,EAAE;YACF,SAAS,EAAE,KAAK;YAChB,GAAG,EAAE,GAAG;SACX;KACJ;CACJ,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IA0Cb,AAAP,MAAM,CAAC,kBAAkB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6D,EAC7D,KAAK,EACL;QACI,QAAQ,EAAE;YACN,SAAS,EAAE,KAAK;YAChB,GAAG,EAAE,GAAG;SACX;QACD,KAAK,EAAE;YACH,IAAI,EAAE;gBACF,SAAS,EAAE,KAAK;gBAChB,GAAG,EAAE,GAAG;aACX;SACJ;KACJ,CACJ;6CAIA;AAiEgB;IA/DhB,IAAI,CACD,4BAA4B,EAC5B;QACI,KAAK,EAAE,OAAO;QACd,SAAS;KACZ,EACD;;kBAEU,qBAAqB;EACrC,CACG;IACA,IAAI,CACD,uBAAuB,EACvB;QACI,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,IAAI;KACb,EACD;;aAEK,gBAAgB;EAC3B,CACG;IACA,IAAI,CACD,iBAAiB,EACjB;QACI,KAAK,EAAE,OAAO;QACd,aAAa,EAAE;YACX,SAAS;SACZ;KACJ,EACD;;;oBAGY,qBAAqB;;EAEvC,CACG;IACA,IAAI,CACD,mBAAmB,EACnB;QACI,KAAK,EAAE,OAAO;QACd,aAAa,EAAE;YACX,kBAAkB,EAAE;gBAChB,SAAS;aACZ;SACJ;KACJ,EACD;;;;sBAIc,qBAAqB;;;EAGzC,CACG;IACA,IAAI,CACD,0BAA0B,EAC1B,EAAE,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,EACnB;cACM,oBAAoB;EAChC,CACG;kDAWA;AAIgB;IAFhB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;4EAKnD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
|
|
2
|
+
export default class TestDecoratorResolverTest extends AbstractModuleTest {
|
|
3
|
+
protected static counter: number;
|
|
4
|
+
protected static beforeAll(): Promise<void>;
|
|
5
|
+
protected static afterAll(): Promise<void>;
|
|
6
|
+
protected canCreateTestDecoratorResolver(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var TestDecoratorResolverTest_1;
|
|
8
|
+
import assert from '../../../utilities/assert.js';
|
|
9
|
+
import test, { suite } from '../../../utilities/decorators.js';
|
|
10
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
|
|
11
|
+
import TestDecoratorResolver from '../../../utilities/TestDecoratorResolver.js';
|
|
12
|
+
let TestDecoratorResolverTest = class TestDecoratorResolverTest extends AbstractModuleTest {
|
|
13
|
+
static { TestDecoratorResolverTest_1 = this; }
|
|
14
|
+
static counter = 4;
|
|
15
|
+
static async beforeAll() {
|
|
16
|
+
await super.beforeAll();
|
|
17
|
+
assert.isEqual(this.counter, 4, 'beforeAll did not access correct static property');
|
|
18
|
+
}
|
|
19
|
+
static async afterAll() {
|
|
20
|
+
await super.afterAll();
|
|
21
|
+
assert.isEqual(this.counter, 10, 'afterAll did not access correct static property');
|
|
22
|
+
}
|
|
23
|
+
async canCreateTestDecoratorResolver() {
|
|
24
|
+
TestDecoratorResolverTest_1.counter = 10;
|
|
25
|
+
const activeTest = TestDecoratorResolver.getActiveTest();
|
|
26
|
+
assert.isInstanceOf(activeTest, TestDecoratorResolverTest_1, 'getActive test is not this on instance test');
|
|
27
|
+
const activeTest2 = TestDecoratorResolver.getActiveTest();
|
|
28
|
+
assert.isEqual(activeTest, activeTest2, 'getActiveTest called a second time did not return same instance');
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
__decorate([
|
|
32
|
+
test()
|
|
33
|
+
], TestDecoratorResolverTest.prototype, "canCreateTestDecoratorResolver", null);
|
|
34
|
+
TestDecoratorResolverTest = TestDecoratorResolverTest_1 = __decorate([
|
|
35
|
+
suite()
|
|
36
|
+
], TestDecoratorResolverTest);
|
|
37
|
+
export default TestDecoratorResolverTest;
|
|
38
|
+
//# sourceMappingURL=TestDecoratorResolver.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestDecoratorResolver.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/TestDecoratorResolver.test.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AAEpE,OAAO,qBAAqB,MAAM,6CAA6C,CAAA;AAGhE,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,kBAAkB;;IAC3D,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;IAElB,MAAM,CAAC,KAAK,CAAC,SAAS;QAC5B,MAAM,KAAK,CAAC,SAAS,EAAE,CAAA;QAEvB,MAAM,CAAC,OAAO,CACV,IAAI,CAAC,OAAO,EACZ,CAAC,EACD,kDAAkD,CACrD,CAAA;IACL,CAAC;IAES,MAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAA;QAEtB,MAAM,CAAC,OAAO,CACV,IAAI,CAAC,OAAO,EACZ,EAAE,EACF,iDAAiD,CACpD,CAAA;IACL,CAAC;IAGe,AAAN,KAAK,CAAC,8BAA8B;QAC1C,2BAAyB,CAAC,OAAO,GAAG,EAAE,CAAA;QAEtC,MAAM,UAAU,GAAG,qBAAqB,CAAC,aAAa,EAAE,CAAA;QAExD,MAAM,CAAC,YAAY,CACf,UAAU,EACV,2BAAyB,EACzB,6CAA6C,CAChD,CAAA;QAED,MAAM,WAAW,GAAG,qBAAqB,CAAC,aAAa,EAAE,CAAA;QAEzD,MAAM,CAAC,OAAO,CACV,UAAU,EACV,WAAW,EACX,iEAAiE,CACpE,CAAA;IACL,CAAC;;AAlBe;IADf,IAAI,EAAE;+EAmBN;AA1CgB,yBAAyB;IAD7C,KAAK,EAAE;GACa,yBAAyB,CA2C7C;eA3CoB,yBAAyB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
|
|
2
|
+
export default class TestOnBasic extends AbstractModuleTest {
|
|
3
|
+
protected static beforeAll(): Promise<void>;
|
|
4
|
+
protected static beforeEach(): Promise<void>;
|
|
5
|
+
protected static afterEach(): Promise<void>;
|
|
6
|
+
protected static calledBeforeAll(): Promise<void>;
|
|
7
|
+
protected static calledBeforeAndAfterEach(): Promise<void>;
|
|
8
|
+
protected static basicPassingTest(): Promise<void>;
|
|
9
|
+
protected static canAccessVarsFromDecorator(hello: string, world: string): Promise<void>;
|
|
10
|
+
protected static asyncWaits(): Promise<void>;
|
|
11
|
+
protected static todo(): Promise<void>;
|
|
12
|
+
}
|