@neurodevs/node-tdd 1.0.5 → 1.0.7

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.
Files changed (179) hide show
  1. package/package.json +1 -1
  2. package/.nvmrc +0 -1
  3. package/.vscode/launch.json +0 -53
  4. package/.vscode/settings.json +0 -62
  5. package/.vscode/tasks.json +0 -99
  6. package/build/__tests__/MockFetch.d.ts +0 -18
  7. package/build/__tests__/MockFetch.js +0 -55
  8. package/build/__tests__/MockFetch.js.map +0 -1
  9. package/build/__tests__/behavioral/AbstractModuleTest.test.d.ts +0 -5
  10. package/build/__tests__/behavioral/AbstractModuleTest.test.js +0 -22
  11. package/build/__tests__/behavioral/AbstractModuleTest.test.js.map +0 -1
  12. package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.d.ts +0 -5
  13. package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.js +0 -34
  14. package/build/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.js.map +0 -1
  15. package/build/__tests__/behavioral/utilities/Assert.test.d.ts +0 -45
  16. package/build/__tests__/behavioral/utilities/Assert.test.js +0 -645
  17. package/build/__tests__/behavioral/utilities/Assert.test.js.map +0 -1
  18. package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.d.ts +0 -4
  19. package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.js +0 -23
  20. package/build/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.js.map +0 -1
  21. package/build/__tests__/behavioral/utilities/MockFetch.test.d.ts +0 -28
  22. package/build/__tests__/behavioral/utilities/MockFetch.test.js +0 -211
  23. package/build/__tests__/behavioral/utilities/MockFetch.test.js.map +0 -1
  24. package/build/__tests__/behavioral/utilities/StackCleaner.test.d.ts +0 -4
  25. package/build/__tests__/behavioral/utilities/StackCleaner.test.js +0 -46
  26. package/build/__tests__/behavioral/utilities/StackCleaner.test.js.map +0 -1
  27. package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.d.ts +0 -7
  28. package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.js +0 -32
  29. package/build/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.js.map +0 -1
  30. package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.d.ts +0 -4
  31. package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.js +0 -19
  32. package/build/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.js.map +0 -1
  33. package/build/__tests__/behavioral/utilities/Stringify.test.d.ts +0 -5
  34. package/build/__tests__/behavioral/utilities/Stringify.test.js +0 -127
  35. package/build/__tests__/behavioral/utilities/Stringify.test.js.map +0 -1
  36. package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.d.ts +0 -7
  37. package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.js +0 -38
  38. package/build/__tests__/behavioral/utilities/TestDecoratorResolver.test.js.map +0 -1
  39. package/build/__tests__/behavioral/utilities/TestOnBasic.test.d.ts +0 -12
  40. package/build/__tests__/behavioral/utilities/TestOnBasic.test.js +0 -68
  41. package/build/__tests__/behavioral/utilities/TestOnBasic.test.js.map +0 -1
  42. package/build/__tests__/behavioral/utilities/TestOnInstance.test.d.ts +0 -28
  43. package/build/__tests__/behavioral/utilities/TestOnInstance.test.js +0 -289
  44. package/build/__tests__/behavioral/utilities/TestOnInstance.test.js.map +0 -1
  45. package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.d.ts +0 -9
  46. package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.js +0 -118
  47. package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.js.map +0 -1
  48. package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.d.ts +0 -5
  49. package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.js +0 -78
  50. package/build/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.js.map +0 -1
  51. package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.d.ts +0 -4
  52. package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.js +0 -23
  53. package/build/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.js.map +0 -1
  54. package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.d.ts +0 -4
  55. package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.js +0 -24
  56. package/build/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.js.map +0 -1
  57. package/build/__tests__/behavioral/utilities/TestResolver.test.d.ts +0 -7
  58. package/build/__tests__/behavioral/utilities/TestResolver.test.js +0 -38
  59. package/build/__tests__/behavioral/utilities/TestResolver.test.js.map +0 -1
  60. package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.d.ts +0 -4
  61. package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.js +0 -20
  62. package/build/__tests__/behavioral/utilities/TestResolverOnStatic.test.js.map +0 -1
  63. package/build/__tests__/behavioral/workspace/JestJsonParser.test.d.ts +0 -18
  64. package/build/__tests__/behavioral/workspace/JestJsonParser.test.js +0 -267
  65. package/build/__tests__/behavioral/workspace/JestJsonParser.test.js.map +0 -1
  66. package/build/__tests__/behavioral/workspace/TestReporter.test.d.ts +0 -27
  67. package/build/__tests__/behavioral/workspace/TestReporter.test.js +0 -508
  68. package/build/__tests__/behavioral/workspace/TestReporter.test.js.map +0 -1
  69. package/build/__tests__/behavioral/workspace/TestRunner.test.d.ts +0 -15
  70. package/build/__tests__/behavioral/workspace/TestRunner.test.js +0 -99
  71. package/build/__tests__/behavioral/workspace/TestRunner.test.js.map +0 -1
  72. package/build/__tests__/behavioral/workspace/Widgets.test.d.ts +0 -16
  73. package/build/__tests__/behavioral/workspace/Widgets.test.js +0 -134
  74. package/build/__tests__/behavioral/workspace/Widgets.test.js.map +0 -1
  75. package/build/__tests__/mock-terminal-kit.d.ts +0 -79
  76. package/build/__tests__/mock-terminal-kit.js +0 -103
  77. package/build/__tests__/mock-terminal-kit.js.map +0 -1
  78. package/build/__tests__/support/AbstractForInstanceTest.d.ts +0 -4
  79. package/build/__tests__/support/AbstractForInstanceTest.js +0 -9
  80. package/build/__tests__/support/AbstractForInstanceTest.js.map +0 -1
  81. package/build/__tests__/support/AbstractLevelOneTest.d.ts +0 -3
  82. package/build/__tests__/support/AbstractLevelOneTest.js +0 -4
  83. package/build/__tests__/support/AbstractLevelOneTest.js.map +0 -1
  84. package/build/__tests__/support/AbstractLevelTwoTest.d.ts +0 -7
  85. package/build/__tests__/support/AbstractLevelTwoTest.js +0 -14
  86. package/build/__tests__/support/AbstractLevelTwoTest.js.map +0 -1
  87. package/build/__tests__/support/AbstractStaticTest.d.ts +0 -7
  88. package/build/__tests__/support/AbstractStaticTest.js +0 -14
  89. package/build/__tests__/support/AbstractStaticTest.js.map +0 -1
  90. package/build/__tests__/support/AbstractTestOnInstanceTest.d.ts +0 -22
  91. package/build/__tests__/support/AbstractTestOnInstanceTest.js +0 -23
  92. package/build/__tests__/support/AbstractTestOnInstanceTest.js.map +0 -1
  93. package/build/__tests__/support/AbstractTestOnInstanceWithHooks.d.ts +0 -26
  94. package/build/__tests__/support/AbstractTestOnInstanceWithHooks.js +0 -59
  95. package/build/__tests__/support/AbstractTestOnInstanceWithHooks.js.map +0 -1
  96. package/build/__tests__/support/jest.setup.d.ts +0 -1
  97. package/build/__tests__/support/jest.setup.js +0 -4
  98. package/build/__tests__/support/jest.setup.js.map +0 -1
  99. package/build/__tests__/support/onTestFileResult.d.ts +0 -244
  100. package/build/__tests__/support/onTestFileResult.js +0 -980
  101. package/build/__tests__/support/onTestFileResult.js.map +0 -1
  102. package/eslint.config.js +0 -3
  103. package/prettier.config.js +0 -3
  104. package/src/.spruce/settings.json +0 -4
  105. package/src/__tests__/MockFetch.ts +0 -100
  106. package/src/__tests__/behavioral/AbstractModuleTest.test.ts +0 -15
  107. package/src/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.ts +0 -31
  108. package/src/__tests__/behavioral/utilities/Assert.test.ts +0 -826
  109. package/src/__tests__/behavioral/utilities/InstanceParentTestCanAccessParentMethods.test.ts +0 -14
  110. package/src/__tests__/behavioral/utilities/MockFetch.test.ts +0 -240
  111. package/src/__tests__/behavioral/utilities/StackCleaner.test.ts +0 -46
  112. package/src/__tests__/behavioral/utilities/StaticParentTestCanAccessParentMethods.test.ts +0 -34
  113. package/src/__tests__/behavioral/utilities/StaticTestInheritsAbstractSpruceTestProperly.test.ts +0 -11
  114. package/src/__tests__/behavioral/utilities/Stringify.test.ts +0 -169
  115. package/src/__tests__/behavioral/utilities/TestDecoratorResolver.test.ts +0 -51
  116. package/src/__tests__/behavioral/utilities/TestOnBasic.test.ts +0 -62
  117. package/src/__tests__/behavioral/utilities/TestOnInstance.test.ts +0 -439
  118. package/src/__tests__/behavioral/utilities/TestOnInstanceExtendsTest.test.ts +0 -237
  119. package/src/__tests__/behavioral/utilities/TestOnInstanceExtendsTestWithHooks.test.ts +0 -85
  120. package/src/__tests__/behavioral/utilities/TestOnInstanceWithParentBeforeAll.test.ts +0 -14
  121. package/src/__tests__/behavioral/utilities/TestOnInstanceWithTwoLevelsOfInheritence.test.ts +0 -16
  122. package/src/__tests__/behavioral/utilities/TestResolver.test.ts +0 -48
  123. package/src/__tests__/behavioral/utilities/TestResolverOnStatic.test.ts +0 -12
  124. package/src/__tests__/behavioral/workspace/JestJsonParser.test.ts +0 -357
  125. package/src/__tests__/behavioral/workspace/TestReporter.test.ts +0 -584
  126. package/src/__tests__/behavioral/workspace/TestRunner.test.ts +0 -87
  127. package/src/__tests__/behavioral/workspace/Widgets.test.ts +0 -131
  128. package/src/__tests__/mock-terminal-kit.ts +0 -115
  129. package/src/__tests__/support/AbstractForInstanceTest.ts +0 -12
  130. package/src/__tests__/support/AbstractLevelOneTest.ts +0 -3
  131. package/src/__tests__/support/AbstractLevelTwoTest.ts +0 -16
  132. package/src/__tests__/support/AbstractStaticTest.ts +0 -16
  133. package/src/__tests__/support/AbstractTestOnInstanceTest.ts +0 -30
  134. package/src/__tests__/support/AbstractTestOnInstanceWithHooks.ts +0 -138
  135. package/src/__tests__/support/jest.setup.ts +0 -2
  136. package/src/__tests__/support/onTestFileResult.ts +0 -1008
  137. package/src/impl/AbstractModuleTest.ts +0 -67
  138. package/src/index.ts +0 -12
  139. package/src/utilities/AssertionError.ts +0 -14
  140. package/src/utilities/StackCleaner.ts +0 -14
  141. package/src/utilities/TestDecoratorResolver.ts +0 -118
  142. package/src/utilities/assert.ts +0 -583
  143. package/src/utilities/assert.utility.ts +0 -295
  144. package/src/utilities/decorators.ts +0 -167
  145. package/src/workspace/CommandService.ts +0 -256
  146. package/src/workspace/JestJsonParser.ts +0 -255
  147. package/src/workspace/TKButtonWidget.ts +0 -54
  148. package/src/workspace/TestLogItemGenerator.ts +0 -184
  149. package/src/workspace/TestReporter.ts +0 -880
  150. package/src/workspace/TestRunner.ts +0 -128
  151. package/src/workspace/TkBaseWidget.ts +0 -249
  152. package/src/workspace/TkInputWidget.ts +0 -83
  153. package/src/workspace/TkLayoutCellWidget.ts +0 -46
  154. package/src/workspace/TkLayoutWidget.ts +0 -181
  155. package/src/workspace/TkMenuBarWidget.ts +0 -95
  156. package/src/workspace/TkPopupWidget.ts +0 -47
  157. package/src/workspace/TkProgressBarWidget.ts +0 -54
  158. package/src/workspace/TkTextWidget.ts +0 -167
  159. package/src/workspace/TkWindowWidget.ts +0 -122
  160. package/src/workspace/WidgetFactory.ts +0 -33
  161. package/src/workspace/button.types.ts +0 -19
  162. package/src/workspace/duration.utility.ts +0 -34
  163. package/src/workspace/factory.types.ts +0 -101
  164. package/src/workspace/input.types.ts +0 -22
  165. package/src/workspace/keySelectChoices.ts +0 -134
  166. package/src/workspace/layout.types.ts +0 -40
  167. package/src/workspace/menuBar.types.ts +0 -24
  168. package/src/workspace/popup.types.ts +0 -17
  169. package/src/workspace/progressBar.types.ts +0 -13
  170. package/src/workspace/table.types.ts +0 -9
  171. package/src/workspace/termKit.utility.ts +0 -130
  172. package/src/workspace/terminal-kit.d.ts +0 -28
  173. package/src/workspace/test.types.ts +0 -34
  174. package/src/workspace/testRunner.cli.ts +0 -166
  175. package/src/workspace/text.types.ts +0 -27
  176. package/src/workspace/widget.utilities.ts +0 -35
  177. package/src/workspace/widgets.types.ts +0 -102
  178. package/src/workspace/window.types.ts +0 -22
  179. package/tsconfig.json +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neurodevs/node-tdd",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "A Node.js framework for test-driven development (TDD)",
5
5
  "type": "module",
6
6
  "keywords": [
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- lts/*
@@ -1,53 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "attach",
7
- "name": "attach.tests",
8
- "port": 5200,
9
- "restart": true,
10
- "timeout": 10000
11
- },
12
- {
13
- "type": "node",
14
- "request": "launch",
15
- "name": "test.file",
16
- "runtimeExecutable": "node",
17
- "runtimeArgs": [
18
- "--inspect-brk",
19
- "--trace-warnings",
20
- "${workspaceFolder}/node_modules/.bin/jest",
21
- "${fileBasenameNoExtension}",
22
- "--detectOpenHandles"
23
- ],
24
- "cwd": "${workspaceFolder}",
25
- "console": "integratedTerminal",
26
- "internalConsoleOptions": "neverOpen"
27
- },
28
- {
29
- "type": "node",
30
- "request": "launch",
31
- "name": "test.all",
32
- "runtimeExecutable": "node",
33
- "runtimeArgs": [
34
- "--inspect-brk",
35
- "--trace-warnings",
36
- "${workspaceFolder}/node_modules/.bin/jest"
37
- ],
38
- "cwd": "${workspaceFolder}",
39
- "console": "integratedTerminal",
40
- "internalConsoleOptions": "neverOpen"
41
- },
42
- {
43
- "type": "node",
44
- "request": "launch",
45
- "name": "boot",
46
- "runtimeExecutable": "yarn",
47
- "runtimeArgs": ["run", "--inspect-brk", "--trace-warnings", "boot"],
48
- "cwd": "${workspaceFolder}",
49
- "console": "integratedTerminal",
50
- "internalConsoleOptions": "neverOpen"
51
- }
52
- ]
53
- }
@@ -1,62 +0,0 @@
1
- {
2
- "debug.node.autoAttach": "on",
3
- "git.ignoreLimitWarning": true,
4
- "javascript.validate.enable": false,
5
- "files.watcherExclude": {
6
- "**/.git/objects/**": true,
7
- "**/.git/subtree-cache/**": true,
8
- "**/build/**": true,
9
- "**/node_modules/**": true
10
- },
11
- "search.exclude": {
12
- "**/build/**": true,
13
- "**/node_modules/**": true,
14
- "**/.next/**": true
15
- },
16
- "editor.codeActionsOnSave": {
17
- "source.fixAll.eslint": "always"
18
- },
19
- "editor.formatOnSave": true,
20
- "editor.formatOnSaveMode": "file",
21
- "editor.defaultFormatter": "esbenp.prettier-vscode",
22
- "editor.maxTokenizationLineLength": 20000000,
23
- "[javascript]": {
24
- "editor.defaultFormatter": "esbenp.prettier-vscode",
25
- "editor.formatOnSave": true
26
- },
27
- "[javascriptreact]": {
28
- "editor.defaultFormatter": "esbenp.prettier-vscode",
29
- "editor.formatOnSave": true
30
- },
31
- "[typescript]": {
32
- "editor.defaultFormatter": "esbenp.prettier-vscode",
33
- "editor.formatOnSave": true
34
- },
35
- "[typescriptreact]": {
36
- "editor.defaultFormatter": "esbenp.prettier-vscode",
37
- "editor.formatOnSave": true
38
- },
39
- "eslint.enable": true,
40
- "eslint.useFlatConfig": true,
41
- "eslint.validate": [
42
- "javascript",
43
- "javascriptreact",
44
- "typescript",
45
- "typescriptreact"
46
- ],
47
- "eslint.workingDirectories": ["./"],
48
- "debug.javascript.unmapMissingSources": true,
49
- "javascript.preferences.importModuleSpecifier": "relative",
50
- "typescript.preferences.importModuleSpecifier": "relative",
51
- "typescript.tsdk": "node_modules/typescript/lib",
52
- "typescript.validate.enable": true,
53
- "cSpell.ignorePaths": [
54
- "**/package-lock.json",
55
- "**/node_modules/**",
56
- "**/build/**",
57
- "**/vscode-extension/**",
58
- "**/.git/objects/**",
59
- ".vscode"
60
- ],
61
- "cSpell.words": ["arkit", "autogenerated", "scrollable", "serializable"]
62
- }
@@ -1,99 +0,0 @@
1
- {
2
- "version": "2.0.0",
3
- "tasks": [
4
- {
5
- "type": "npm",
6
- "script": "watch.build.dev",
7
- "group": "build",
8
- "label": "watch.build.dev & problem.watcher",
9
- "isBackground": true,
10
- "runOptions": {
11
- "runOn": "folderOpen"
12
- },
13
- "promptOnClose": false,
14
- "presentation": {
15
- "focus": false,
16
- "reveal": "never"
17
- },
18
- "problemMatcher": {
19
- "base": "$tsc-watch",
20
- "applyTo": "allDocuments"
21
- }
22
- },
23
- {
24
- "label": "test.file",
25
- "type": "shell",
26
- "command": "node build/workspace/testRunner.cli.js --pattern \"${fileBasenameNoExtension}\" --watchMode standard --inspect 5200",
27
- "promptOnClose": false,
28
- "group": {
29
- "kind": "test",
30
- "isDefault": true
31
- },
32
- "presentation": {
33
- "reveal": "always",
34
- "panel": "dedicated"
35
- },
36
- "problemMatcher": []
37
- },
38
- {
39
- "label": "test.reporter",
40
- "type": "shell",
41
- "command": "node build/workspace/testRunner.cli.js --watchMode standard",
42
- "promptOnClose": false,
43
- "group": "test",
44
- "runOptions": {
45
- "runOn": "folderOpen"
46
- },
47
- "presentation": {
48
- "panel": "shared",
49
- "focus": true,
50
- "reveal": "always"
51
- },
52
- "problemMatcher": []
53
- },
54
- {
55
- "label": "shell",
56
- "type": "shell",
57
- "command": "${input:command} ${input:optionsCommand}",
58
- "problemMatcher": [],
59
- "presentation": {
60
- "reveal": "always",
61
- "focus": true,
62
- "panel": "new",
63
- "clear": false
64
- }
65
- },
66
- {
67
- "label": "ndx",
68
- "type": "shell",
69
- "command": "ndx ${input:ndxCommand}",
70
- "problemMatcher": [],
71
- "presentation": {
72
- "reveal": "always",
73
- "focus": true,
74
- "panel": "new",
75
- "clear": false
76
- }
77
- }
78
- ],
79
- "inputs": [
80
- {
81
- "id": "command",
82
- "description": "command",
83
- "default": "yarn",
84
- "type": "promptString"
85
- },
86
- {
87
- "id": "optionsCommand",
88
- "description": "optionsCommand",
89
- "default": "add",
90
- "type": "promptString"
91
- },
92
- {
93
- "id": "ndxCommand",
94
- "description": "ndx command",
95
- "default": "create.module",
96
- "type": "promptString"
97
- }
98
- ]
99
- }
@@ -1,18 +0,0 @@
1
- export default class MockFetch {
2
- private requestLog;
3
- private responses;
4
- buildFetch(): typeof fetch;
5
- assertWasCalled(url?: string | URL, init?: RequestInit): void;
6
- private get lastInit();
7
- private get wasCalled();
8
- private get urlsCalled();
9
- private get lastUrl();
10
- assertMadeRequests(expected: ExpectedRequest[]): void;
11
- setResponse(response: Response, url?: string | URL | Request, init?: RequestInit): void;
12
- private generateResponseKey;
13
- }
14
- export interface RequestObject {
15
- url: string | URL | Request;
16
- init?: RequestInit;
17
- }
18
- export type ExpectedRequest = string | URL | RequestObject;
@@ -1,55 +0,0 @@
1
- import assert from '../utilities/assert.js';
2
- export default class MockFetch {
3
- requestLog = [];
4
- responses = {
5
- '*': new Response(JSON.stringify({
6
- success: true,
7
- }), { status: 200 }),
8
- };
9
- buildFetch() {
10
- return async (url, init) => {
11
- this.requestLog.push({ url, init });
12
- const key = this.generateResponseKey(url, init);
13
- return (this.responses[key] ?? this.responses['*']).clone();
14
- };
15
- }
16
- assertWasCalled(url, init) {
17
- assert.isTruthy(this.wasCalled, 'Expected fetch() to have been called.');
18
- if (url) {
19
- const lastUrl = this.lastUrl;
20
- assert.isEqual(lastUrl, url, `Expected fetch() to have been called with URL "${url}", but it was called with "${lastUrl}".`);
21
- }
22
- if (init) {
23
- assert.isEqualDeep(this.lastInit, init, `Expected fetch() to have been called with init "${JSON.stringify(init)}", but it was called with "${JSON.stringify(this.lastInit)}".`);
24
- }
25
- }
26
- get lastInit() {
27
- return this.requestLog[this.requestLog.length - 1].init;
28
- }
29
- get wasCalled() {
30
- return this.requestLog.length > 0;
31
- }
32
- get urlsCalled() {
33
- return this.requestLog.map((req) => req.url);
34
- }
35
- get lastUrl() {
36
- return this.urlsCalled[this.urlsCalled.length - 1];
37
- }
38
- assertMadeRequests(expected) {
39
- const expectedAsObjects = expected.map((req) => {
40
- if (typeof req === 'string' || req instanceof URL) {
41
- return { url: req, init: undefined };
42
- }
43
- return req;
44
- });
45
- assert.isEqualDeep(this.requestLog, expectedAsObjects, `Expected fetch() to have been called with URL and init combinations as specified.`);
46
- }
47
- setResponse(response, url, init) {
48
- const key = this.generateResponseKey(url, init);
49
- this.responses[key] = response;
50
- }
51
- generateResponseKey(url, init) {
52
- return `${url?.toString() ?? '*'}${init ? JSON.stringify(init) : ''}`;
53
- }
54
- }
55
- //# sourceMappingURL=MockFetch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MockFetch.js","sourceRoot":"","sources":["../../src/__tests__/MockFetch.ts"],"names":[],"mappings":"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"}
@@ -1,5 +0,0 @@
1
- import AbstractModuleTest from '../../impl/AbstractModuleTest.js';
2
- export default class AbstractModuleTestClassTest extends AbstractModuleTest {
3
- protected static beforeEach(): Promise<void>;
4
- protected static hasProtectedStaticGenerateIdMethod(): Promise<void>;
5
- }
@@ -1,22 +0,0 @@
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 test from '../../utilities/decorators.js';
9
- import assert from '../../utilities/assert.js';
10
- export default class AbstractModuleTestClassTest extends AbstractModuleTest {
11
- static async beforeEach() {
12
- await super.beforeEach();
13
- }
14
- static async hasProtectedStaticGenerateIdMethod() {
15
- const randomId = AbstractModuleTest.generateId();
16
- assert.isTruthy(randomId, 'generateId did not return an id!');
17
- }
18
- }
19
- __decorate([
20
- test()
21
- ], AbstractModuleTestClassTest, "hasProtectedStaticGenerateIdMethod", null);
22
- //# sourceMappingURL=AbstractModuleTest.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractModuleTest.test.js","sourceRoot":"","sources":["../../../src/__tests__/behavioral/AbstractModuleTest.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,kBAAkB,MAAM,kCAAkC,CAAA;AACjE,OAAO,IAAI,MAAM,+BAA+B,CAAA;AAChD,OAAO,MAAM,MAAM,2BAA2B,CAAA;AAE9C,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,kBAAkB;IAC7D,MAAM,CAAC,KAAK,CAAC,UAAU;QAC7B,MAAM,KAAK,CAAC,UAAU,EAAE,CAAA;IAC5B,CAAC;IAGsB,AAAb,MAAM,CAAC,KAAK,CAAC,kCAAkC;QACrD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,UAAU,EAAE,CAAA;QAChD,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,kCAAkC,CAAC,CAAA;IACjE,CAAC;CACJ;AAJ0B;IADtB,IAAI,EAAE;2EAIN"}
@@ -1,5 +0,0 @@
1
- import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
2
- export default class AllHooksCalledEvenIfNotDefinedTest extends AbstractModuleTest {
3
- protected static afterAll(): Promise<void>;
4
- protected static canCreateAllHooksCalledEvenIfNotDefined(): Promise<void>;
5
- }
@@ -1,34 +0,0 @@
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 TestDecoratorResolver from '../../../utilities/TestDecoratorResolver.js';
10
- import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
11
- let beforeBeforeAllCount = 0;
12
- let afterBeforeAllCount = 0;
13
- let beforeAfterAll = 0;
14
- export default class AllHooksCalledEvenIfNotDefinedTest extends AbstractModuleTest {
15
- static async afterAll() {
16
- assert.isEqual(beforeBeforeAllCount, 1);
17
- assert.isEqual(afterBeforeAllCount, 1);
18
- assert.isEqual(beforeAfterAll, 1);
19
- }
20
- static async canCreateAllHooksCalledEvenIfNotDefined() { }
21
- }
22
- __decorate([
23
- test()
24
- ], AllHooksCalledEvenIfNotDefinedTest, "canCreateAllHooksCalledEvenIfNotDefined", null);
25
- TestDecoratorResolver.onWillCallBeforeAll(() => {
26
- beforeBeforeAllCount++;
27
- });
28
- TestDecoratorResolver.onDidCallBeforeAll(() => {
29
- afterBeforeAllCount++;
30
- });
31
- TestDecoratorResolver.onWillCallAfterAll(() => {
32
- beforeAfterAll++;
33
- });
34
- //# sourceMappingURL=AllHooksCalledEvenIfNotDefined.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AllHooksCalledEvenIfNotDefined.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/utilities/AllHooksCalledEvenIfNotDefined.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAM,MAAM,8BAA8B,CAAA;AACjD,OAAO,IAAI,MAAM,kCAAkC,CAAA;AACnD,OAAO,qBAAqB,MAAM,6CAA6C,CAAA;AAC/E,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AAEpE,IAAI,oBAAoB,GAAG,CAAC,CAAA;AAC5B,IAAI,mBAAmB,GAAG,CAAC,CAAA;AAC3B,IAAI,cAAc,GAAG,CAAC,CAAA;AAEtB,MAAM,CAAC,OAAO,OAAO,kCAAmC,SAAQ,kBAAkB;IACpE,MAAM,CAAC,KAAK,CAAC,QAAQ;QAC3B,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAA;QACvC,MAAM,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAA;QACtC,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAA;IACrC,CAAC;IAGsB,AAAb,MAAM,CAAC,KAAK,CAAC,uCAAuC,KAAI,CAAC;CACtE;AAD0B;IADtB,IAAI,EAAE;uFAC4D;AAGvE,qBAAqB,CAAC,mBAAmB,CAAC,GAAG,EAAE;IAC3C,oBAAoB,EAAE,CAAA;AAC1B,CAAC,CAAC,CAAA;AAEF,qBAAqB,CAAC,kBAAkB,CAAC,GAAG,EAAE;IAC1C,mBAAmB,EAAE,CAAA;AACzB,CAAC,CAAC,CAAA;AAEF,qBAAqB,CAAC,kBAAkB,CAAC,GAAG,EAAE;IAC1C,cAAc,EAAE,CAAA;AACpB,CAAC,CAAC,CAAA"}
@@ -1,45 +0,0 @@
1
- import AbstractModuleTest from '../../../impl/AbstractModuleTest.js';
2
- export default class AssertTest extends AbstractModuleTest {
3
- protected static canHandleAsyncThrows(): Promise<void>;
4
- protected static canDetectNoErrorThrown(): Promise<void>;
5
- protected static isEqual(): void;
6
- protected static isAbove(): void;
7
- protected static isBelow(): Promise<void>;
8
- protected static typeTests(): Promise<void>;
9
- protected static canMatchErrorByString(): Promise<void>;
10
- protected static doesNotMatchErrorByBadString(): Promise<void>;
11
- protected static throwMatchesErrorByRegex(): Promise<void>;
12
- protected static throwReturnsTheError(): Promise<void>;
13
- protected static doesNotMatchErrorByBadRegex(): Promise<void>;
14
- protected static doesNotMatchErrorByBadRegexAsync(): Promise<void>;
15
- protected static assertIsString(): Promise<void>;
16
- protected static includeAndDoesNotInclude(haystack: any, needle: any): void;
17
- protected static doesIncludeThrowsAsExpected(haystack: any, needle: any, matcher: any): void;
18
- protected static hasAllFunctionsAndPasses(): void;
19
- protected static hasAllFunctionsAndFails(): void;
20
- protected static isTruthy(): void;
21
- protected static isFalsy(): void;
22
- protected static isString(): void;
23
- protected static isTrue(): void;
24
- protected static isFalse(): void;
25
- protected static deepEqual(): void;
26
- protected static isUndefined(): void;
27
- protected static isNotEqual(): void;
28
- protected static fail(): void;
29
- protected static isObject(): void;
30
- protected static isLength(): void;
31
- protected static isNull(): void;
32
- protected static isExactType(): void;
33
- protected static isArray(): void;
34
- protected static isNumber(): void;
35
- protected static canAssertIstanceOf(): void;
36
- protected static printsNiceDiff(): void;
37
- protected static printsNiceDiffWithDoesInclude(): void;
38
- private static simpleDoesIncludePrettyPrint;
39
- protected static doesThrowMatchIsCaseInsensitive(): Promise<void>;
40
- protected static doesNotThrowRegexErrorIfStringNotFound(): Promise<void>;
41
- protected static canFindInBetween(): Promise<void>;
42
- protected static isBetweenInclusive(): Promise<void>;
43
- protected static doesThrowDoesNotCheckErrorStack(): Promise<void>;
44
- protected static doesIncludeThrowsWithExpectedError(): Promise<void>;
45
- }