@tsed/platform-test-sdk 7.83.3 → 8.0.0-alpha.10

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 (185) hide show
  1. package/lib/esm/components/PlatformTestSdk.js +1 -1
  2. package/lib/esm/components/PlatformTestSdk.js.map +1 -1
  3. package/lib/esm/modules/feature/FeatureModule.js.map +1 -1
  4. package/lib/esm/modules/feature/controllers/FeatureController.js +2 -1
  5. package/lib/esm/modules/feature/controllers/FeatureController.js.map +1 -1
  6. package/lib/esm/tests/exports.js +1 -1
  7. package/lib/esm/tests/exports.js.map +1 -1
  8. package/lib/esm/tests/testAcceptMime.js +3 -2
  9. package/lib/esm/tests/testAcceptMime.js.map +1 -1
  10. package/lib/esm/tests/testAuth.js +3 -2
  11. package/lib/esm/tests/testAuth.js.map +1 -1
  12. package/lib/esm/tests/testBodyParams.js +2 -1
  13. package/lib/esm/tests/testBodyParams.js.map +1 -1
  14. package/lib/esm/tests/testCache.js +4 -3
  15. package/lib/esm/tests/testCache.js.map +1 -1
  16. package/lib/esm/tests/testChildrenControllers.js +3 -1
  17. package/lib/esm/tests/testChildrenControllers.js.map +1 -1
  18. package/lib/esm/tests/testCookies.js +3 -1
  19. package/lib/esm/tests/testCookies.js.map +1 -1
  20. package/lib/esm/tests/testCustom404.js +1 -0
  21. package/lib/esm/tests/testCustom404.js.map +1 -1
  22. package/lib/esm/tests/testDeepQueryParams.js +3 -2
  23. package/lib/esm/tests/testDeepQueryParams.js.map +1 -1
  24. package/lib/esm/tests/testErrors.js +9 -8
  25. package/lib/esm/tests/testErrors.js.map +1 -1
  26. package/lib/esm/tests/testHandlers.js +3 -2
  27. package/lib/esm/tests/testHandlers.js.map +1 -1
  28. package/lib/esm/tests/testHeaderParams.js +3 -2
  29. package/lib/esm/tests/testHeaderParams.js.map +1 -1
  30. package/lib/esm/tests/testHeaders.js +7 -6
  31. package/lib/esm/tests/testHeaders.js.map +1 -1
  32. package/lib/esm/tests/testInheritanceController.js +4 -3
  33. package/lib/esm/tests/testInheritanceController.js.map +1 -1
  34. package/lib/esm/tests/testLocals.js +3 -1
  35. package/lib/esm/tests/testLocals.js.map +1 -1
  36. package/lib/esm/tests/testLocation.js +3 -2
  37. package/lib/esm/tests/testLocation.js.map +1 -1
  38. package/lib/esm/tests/testMiddlewares.js +3 -1
  39. package/lib/esm/tests/testMiddlewares.js.map +1 -1
  40. package/lib/esm/tests/testModule.js +3 -1
  41. package/lib/esm/tests/testModule.js.map +1 -1
  42. package/lib/esm/tests/testMulter.js +1 -0
  43. package/lib/esm/tests/testMulter.js.map +1 -1
  44. package/lib/esm/tests/testPathParams.js +3 -2
  45. package/lib/esm/tests/testPathParams.js.map +1 -1
  46. package/lib/esm/tests/testQueryParams.js +3 -2
  47. package/lib/esm/tests/testQueryParams.js.map +1 -1
  48. package/lib/esm/tests/testRedirect.js +4 -2
  49. package/lib/esm/tests/testRedirect.js.map +1 -1
  50. package/lib/esm/tests/testResponse.js +5 -4
  51. package/lib/esm/tests/testResponse.js.map +1 -1
  52. package/lib/esm/tests/testResponseFilter.js +5 -4
  53. package/lib/esm/tests/testResponseFilter.js.map +1 -1
  54. package/lib/esm/tests/testRouting.js +3 -1
  55. package/lib/esm/tests/testRouting.js.map +1 -1
  56. package/lib/esm/tests/testScopeRequest.js +3 -1
  57. package/lib/esm/tests/testScopeRequest.js.map +1 -1
  58. package/lib/esm/tests/testSession.js +3 -2
  59. package/lib/esm/tests/testSession.js.map +1 -1
  60. package/lib/esm/tests/testStatics.js +1 -0
  61. package/lib/esm/tests/testStatics.js.map +1 -1
  62. package/lib/esm/tests/testStream.js +3 -2
  63. package/lib/esm/tests/testStream.js.map +1 -1
  64. package/lib/esm/tests/testView.js +4 -2
  65. package/lib/esm/tests/testView.js.map +1 -1
  66. package/lib/types/components/PlatformTestSdk.d.ts +1 -1
  67. package/package.json +26 -24
  68. package/lib/cjs/components/PlatformTestSdk.js +0 -30
  69. package/lib/cjs/components/PlatformTestSdk.js.map +0 -1
  70. package/lib/cjs/data/response.data.json +0 -3
  71. package/lib/cjs/data/swagger.json +0 -32
  72. package/lib/cjs/errors/CustomBadRequest.js +0 -17
  73. package/lib/cjs/errors/CustomBadRequest.js.map +0 -1
  74. package/lib/cjs/errors/CustomInternalError.js +0 -17
  75. package/lib/cjs/errors/CustomInternalError.js.map +0 -1
  76. package/lib/cjs/index.js +0 -44
  77. package/lib/cjs/index.js.map +0 -1
  78. package/lib/cjs/interfaces/PlatformTestingSdkOpts.js +0 -3
  79. package/lib/cjs/interfaces/PlatformTestingSdkOpts.js.map +0 -1
  80. package/lib/cjs/interfaces/index.js +0 -8
  81. package/lib/cjs/interfaces/index.js.map +0 -1
  82. package/lib/cjs/modules/feature/FeatureModule.js +0 -17
  83. package/lib/cjs/modules/feature/FeatureModule.js.map +0 -1
  84. package/lib/cjs/modules/feature/controllers/FeatureController.js +0 -23
  85. package/lib/cjs/modules/feature/controllers/FeatureController.js.map +0 -1
  86. package/lib/cjs/package.json +0 -3
  87. package/lib/cjs/tests/exports.js +0 -68
  88. package/lib/cjs/tests/exports.js.map +0 -1
  89. package/lib/cjs/tests/testAcceptMime.js +0 -103
  90. package/lib/cjs/tests/testAcceptMime.js.map +0 -1
  91. package/lib/cjs/tests/testAuth.js +0 -343
  92. package/lib/cjs/tests/testAuth.js.map +0 -1
  93. package/lib/cjs/tests/testBodyParams.js +0 -539
  94. package/lib/cjs/tests/testBodyParams.js.map +0 -1
  95. package/lib/cjs/tests/testCache.js +0 -299
  96. package/lib/cjs/tests/testCache.js.map +0 -1
  97. package/lib/cjs/tests/testChildrenControllers.js +0 -64
  98. package/lib/cjs/tests/testChildrenControllers.js.map +0 -1
  99. package/lib/cjs/tests/testCookies.js +0 -45
  100. package/lib/cjs/tests/testCookies.js.map +0 -1
  101. package/lib/cjs/tests/testCustom404.js +0 -32
  102. package/lib/cjs/tests/testCustom404.js.map +0 -1
  103. package/lib/cjs/tests/testDeepQueryParams.js +0 -139
  104. package/lib/cjs/tests/testDeepQueryParams.js.map +0 -1
  105. package/lib/cjs/tests/testErrors.js +0 -253
  106. package/lib/cjs/tests/testErrors.js.map +0 -1
  107. package/lib/cjs/tests/testHandlers.js +0 -106
  108. package/lib/cjs/tests/testHandlers.js.map +0 -1
  109. package/lib/cjs/tests/testHeaderParams.js +0 -169
  110. package/lib/cjs/tests/testHeaderParams.js.map +0 -1
  111. package/lib/cjs/tests/testHeaders.js +0 -85
  112. package/lib/cjs/tests/testHeaders.js.map +0 -1
  113. package/lib/cjs/tests/testInheritanceController.js +0 -239
  114. package/lib/cjs/tests/testInheritanceController.js.map +0 -1
  115. package/lib/cjs/tests/testLocals.js +0 -63
  116. package/lib/cjs/tests/testLocals.js.map +0 -1
  117. package/lib/cjs/tests/testLocation.js +0 -42
  118. package/lib/cjs/tests/testLocation.js.map +0 -1
  119. package/lib/cjs/tests/testMiddlewares.js +0 -210
  120. package/lib/cjs/tests/testMiddlewares.js.map +0 -1
  121. package/lib/cjs/tests/testModule.js +0 -49
  122. package/lib/cjs/tests/testModule.js.map +0 -1
  123. package/lib/cjs/tests/testMulter.js +0 -169
  124. package/lib/cjs/tests/testMulter.js.map +0 -1
  125. package/lib/cjs/tests/testPathParams.js +0 -143
  126. package/lib/cjs/tests/testPathParams.js.map +0 -1
  127. package/lib/cjs/tests/testQueryParams.js +0 -241
  128. package/lib/cjs/tests/testQueryParams.js.map +0 -1
  129. package/lib/cjs/tests/testRedirect.js +0 -143
  130. package/lib/cjs/tests/testRedirect.js.map +0 -1
  131. package/lib/cjs/tests/testResponse.js +0 -569
  132. package/lib/cjs/tests/testResponse.js.map +0 -1
  133. package/lib/cjs/tests/testResponseFilter.js +0 -106
  134. package/lib/cjs/tests/testResponseFilter.js.map +0 -1
  135. package/lib/cjs/tests/testRouting.js +0 -77
  136. package/lib/cjs/tests/testRouting.js.map +0 -1
  137. package/lib/cjs/tests/testScopeRequest.js +0 -113
  138. package/lib/cjs/tests/testScopeRequest.js.map +0 -1
  139. package/lib/cjs/tests/testSession.js +0 -122
  140. package/lib/cjs/tests/testSession.js.map +0 -1
  141. package/lib/cjs/tests/testStatics.js +0 -58
  142. package/lib/cjs/tests/testStatics.js.map +0 -1
  143. package/lib/cjs/tests/testStream.js +0 -65
  144. package/lib/cjs/tests/testStream.js.map +0 -1
  145. package/lib/cjs/tests/testView.js +0 -83
  146. package/lib/cjs/tests/testView.js.map +0 -1
  147. package/lib/esm/package.json +0 -3
  148. package/lib/types-esm/components/PlatformTestSdk.d.ts +0 -9
  149. package/lib/types-esm/errors/CustomBadRequest.d.ts +0 -8
  150. package/lib/types-esm/errors/CustomInternalError.d.ts +0 -8
  151. package/lib/types-esm/index.d.ts +0 -40
  152. package/lib/types-esm/interfaces/PlatformTestingSdkOpts.d.ts +0 -8
  153. package/lib/types-esm/interfaces/index.d.ts +0 -4
  154. package/lib/types-esm/modules/feature/FeatureModule.d.ts +0 -2
  155. package/lib/types-esm/modules/feature/controllers/FeatureController.d.ts +0 -3
  156. package/lib/types-esm/tests/exports.d.ts +0 -2
  157. package/lib/types-esm/tests/testAcceptMime.d.ts +0 -2
  158. package/lib/types-esm/tests/testAuth.d.ts +0 -8
  159. package/lib/types-esm/tests/testBodyParams.d.ts +0 -3
  160. package/lib/types-esm/tests/testCache.d.ts +0 -2
  161. package/lib/types-esm/tests/testChildrenControllers.d.ts +0 -2
  162. package/lib/types-esm/tests/testCookies.d.ts +0 -11
  163. package/lib/types-esm/tests/testCustom404.d.ts +0 -2
  164. package/lib/types-esm/tests/testDeepQueryParams.d.ts +0 -3
  165. package/lib/types-esm/tests/testErrors.d.ts +0 -19
  166. package/lib/types-esm/tests/testHandlers.d.ts +0 -12
  167. package/lib/types-esm/tests/testHeaderParams.d.ts +0 -16
  168. package/lib/types-esm/tests/testHeaders.d.ts +0 -8
  169. package/lib/types-esm/tests/testInheritanceController.d.ts +0 -42
  170. package/lib/types-esm/tests/testLocals.d.ts +0 -2
  171. package/lib/types-esm/tests/testLocation.d.ts +0 -2
  172. package/lib/types-esm/tests/testMiddlewares.d.ts +0 -8
  173. package/lib/types-esm/tests/testModule.d.ts +0 -2
  174. package/lib/types-esm/tests/testMulter.d.ts +0 -21
  175. package/lib/types-esm/tests/testPathParams.d.ts +0 -2
  176. package/lib/types-esm/tests/testQueryParams.d.ts +0 -6
  177. package/lib/types-esm/tests/testRedirect.d.ts +0 -2
  178. package/lib/types-esm/tests/testResponse.d.ts +0 -16
  179. package/lib/types-esm/tests/testResponseFilter.d.ts +0 -2
  180. package/lib/types-esm/tests/testRouting.d.ts +0 -7
  181. package/lib/types-esm/tests/testScopeRequest.d.ts +0 -12
  182. package/lib/types-esm/tests/testSession.d.ts +0 -16
  183. package/lib/types-esm/tests/testStatics.d.ts +0 -2
  184. package/lib/types-esm/tests/testStream.d.ts +0 -2
  185. package/lib/types-esm/tests/testView.d.ts +0 -2
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.testView = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@tsed/common");
6
- const os_1 = require("os");
7
- const supertest_1 = tslib_1.__importDefault(require("supertest"));
8
- const platform_views_1 = require("@tsed/platform-views");
9
- let LocalsMiddleware = class LocalsMiddleware {
10
- use(locals) {
11
- locals.localID = "local-10909";
12
- }
13
- };
14
- tslib_1.__decorate([
15
- tslib_1.__param(0, (0, common_1.Locals)()),
16
- tslib_1.__metadata("design:type", Function),
17
- tslib_1.__metadata("design:paramtypes", [Object]),
18
- tslib_1.__metadata("design:returntype", void 0)
19
- ], LocalsMiddleware.prototype, "use", null);
20
- LocalsMiddleware = tslib_1.__decorate([
21
- (0, common_1.Middleware)()
22
- ], LocalsMiddleware);
23
- let ViewCtrl = class ViewCtrl {
24
- testScenario1() {
25
- return {
26
- world: "world"
27
- };
28
- }
29
- testScenario2() {
30
- return {
31
- world: "world"
32
- };
33
- }
34
- };
35
- tslib_1.__decorate([
36
- (0, common_1.Get)("/scenario-1"),
37
- (0, common_1.UseBefore)(LocalsMiddleware),
38
- (0, platform_views_1.View)("view.ejs", { opts: "opts" }),
39
- tslib_1.__metadata("design:type", Function),
40
- tslib_1.__metadata("design:paramtypes", []),
41
- tslib_1.__metadata("design:returntype", void 0)
42
- ], ViewCtrl.prototype, "testScenario1", null);
43
- tslib_1.__decorate([
44
- (0, common_1.Get)("/scenario-2"),
45
- (0, platform_views_1.View)("view", { opts: "opts" }) // missing extension
46
- ,
47
- tslib_1.__metadata("design:type", Function),
48
- tslib_1.__metadata("design:paramtypes", []),
49
- tslib_1.__metadata("design:returntype", void 0)
50
- ], ViewCtrl.prototype, "testScenario2", null);
51
- ViewCtrl = tslib_1.__decorate([
52
- (0, common_1.Controller)("/views")
53
- ], ViewCtrl);
54
- function testView(options) {
55
- let request;
56
- beforeAll(common_1.PlatformTest.bootstrap(options.server, {
57
- ...options,
58
- mount: {
59
- "/rest": [ViewCtrl]
60
- }
61
- }));
62
- beforeAll(() => {
63
- request = (0, supertest_1.default)(common_1.PlatformTest.callback());
64
- });
65
- afterAll(common_1.PlatformTest.reset);
66
- describe("Scenario1: GET /rest/views/scenario-1", () => {
67
- it("should render a view", async () => {
68
- const response = await request.get("/rest/views/scenario-1").expect(200);
69
- expect(response.headers["content-type"]).toEqual("text/html; charset=utf-8");
70
- expect(response.text).toEqual(`<p>Hello world with opts and ID local-10909</p>${os_1.EOL}`);
71
- });
72
- });
73
- describe("Scenario2: GET /rest/views/scenario-2", () => {
74
- it("should throw an error when extension is not defined", async () => {
75
- const response = await request.get("/rest/views/scenario-2").expect(500);
76
- expect(response.body.name).toEqual("TEMPLATE_RENDER_ERROR");
77
- expect(response.body.message).toContain("Template rendering error: ViewCtrl.testScenario2()");
78
- expect(response.body.status).toEqual(500);
79
- });
80
- });
81
- }
82
- exports.testView = testView;
83
- //# sourceMappingURL=testView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testView.js","sourceRoot":"","sources":["../../../src/tests/testView.ts"],"names":[],"mappings":";;;;AAAA,yCAA0F;AAC1F,2BAAuB;AACvB,kEAAkC;AAClC,yDAA0C;AAI1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACpB,GAAG,CAAW,MAAW;QACvB,MAAM,CAAC,OAAO,GAAG,aAAa,CAAC;IACjC,CAAC;CACF,CAAA;AAHC;IAAK,mBAAA,IAAA,eAAM,GAAE,CAAA;;;;2CAEZ;AAHG,gBAAgB;IADrB,IAAA,mBAAU,GAAE;GACP,gBAAgB,CAIrB;AAGD,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAIZ,aAAa;QACX,OAAO;YACL,KAAK,EAAE,OAAO;SACf,CAAC;IACJ,CAAC;IAID,aAAa;QACX,OAAO;YACL,KAAK,EAAE,OAAO;SACf,CAAC;IACJ,CAAC;CACF,CAAA;AAhBC;IAAC,IAAA,YAAG,EAAC,aAAa,CAAC;IAClB,IAAA,kBAAS,EAAC,gBAAgB,CAAC;IAC3B,IAAA,qBAAI,EAAC,UAAU,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;;;6CAKhC;AAED;IAAC,IAAA,YAAG,EAAC,aAAa,CAAC;IAClB,IAAA,qBAAI,EAAC,MAAM,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC,oBAAoB;;;;;6CAKjD;AAhBG,QAAQ;IADb,IAAA,mBAAU,EAAC,QAAQ,CAAC;GACf,QAAQ,CAiBb;AAED,SAAgB,QAAQ,CAAC,OAA+B;IACtD,IAAI,OAAwB,CAAC;IAE7B,SAAS,CACP,qBAAY,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE;QACrC,GAAG,OAAO;QACV,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,QAAQ,CAAC;SACpB;KACF,CAAC,CACH,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,IAAA,mBAAS,EAAC,qBAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,qBAAY,CAAC,KAAK,CAAC,CAAC;IAE7B,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;QACrD,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAEzE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;YAC7E,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,kDAAkD,QAAG,EAAE,CAAC,CAAC;QACzF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;QACrD,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;YACnE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAEzE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;YAC5D,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,oDAAoD,CAAC,CAAC;YAC9F,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAlCD,4BAkCC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,9 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare class PlatformTestSdk {
3
- private options;
4
- protected constructor(options: PlatformTestingSdkOpts);
5
- static create(options: PlatformTestingSdkOpts): PlatformTestSdk;
6
- test(name: string, options?: any): void;
7
- bootstrap(options?: any): () => Promise<void>;
8
- reset(): typeof import("@tsed/common").DITest.reset;
9
- }
@@ -1,8 +0,0 @@
1
- import { ResponseErrorObject } from "@tsed/common";
2
- import { BadRequest } from "@tsed/exceptions";
3
- export declare class CustomBadRequest extends BadRequest implements ResponseErrorObject {
4
- name: string;
5
- errors: any[];
6
- headers: {};
7
- constructor(message: string);
8
- }
@@ -1,8 +0,0 @@
1
- import { ResponseErrorObject } from "@tsed/common";
2
- import { InternalServerError } from "@tsed/exceptions";
3
- export declare class CustomInternalError extends InternalServerError implements ResponseErrorObject {
4
- name: string;
5
- errors: any[];
6
- headers: {};
7
- constructor(message: string);
8
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * @file Automatically generated by @tsed/barrels.
3
- */
4
- export * from "./components/PlatformTestSdk.js";
5
- export * from "./errors/CustomBadRequest.js";
6
- export * from "./errors/CustomInternalError.js";
7
- export * from "./interfaces/index.js";
8
- export * from "./interfaces/PlatformTestingSdkOpts.js";
9
- export * from "./modules/feature/controllers/FeatureController.js";
10
- export * from "./modules/feature/FeatureModule.js";
11
- export * from "./tests/exports.js";
12
- export * from "./tests/testAcceptMime.js";
13
- export * from "./tests/testAuth.js";
14
- export * from "./tests/testBodyParams.js";
15
- export * from "./tests/testCache.js";
16
- export * from "./tests/testChildrenControllers.js";
17
- export * from "./tests/testCookies.js";
18
- export * from "./tests/testCustom404.js";
19
- export * from "./tests/testDeepQueryParams.js";
20
- export * from "./tests/testErrors.js";
21
- export * from "./tests/testHandlers.js";
22
- export * from "./tests/testHeaderParams.js";
23
- export * from "./tests/testHeaders.js";
24
- export * from "./tests/testInheritanceController.js";
25
- export * from "./tests/testLocals.js";
26
- export * from "./tests/testLocation.js";
27
- export * from "./tests/testMiddlewares.js";
28
- export * from "./tests/testModule.js";
29
- export * from "./tests/testMulter.js";
30
- export * from "./tests/testPathParams.js";
31
- export * from "./tests/testQueryParams.js";
32
- export * from "./tests/testRedirect.js";
33
- export * from "./tests/testResponse.js";
34
- export * from "./tests/testResponseFilter.js";
35
- export * from "./tests/testRouting.js";
36
- export * from "./tests/testScopeRequest.js";
37
- export * from "./tests/testSession.js";
38
- export * from "./tests/testStatics.js";
39
- export * from "./tests/testStream.js";
40
- export * from "./tests/testView.js";
@@ -1,8 +0,0 @@
1
- import { PlatformAdapter } from "@tsed/common";
2
- import { Type } from "@tsed/core";
3
- export interface PlatformTestingSdkOpts {
4
- rootDir: string;
5
- platform: Type<PlatformAdapter<any>>;
6
- server: Type<any>;
7
- [key: string]: any;
8
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * @file Automatically generated by @tsed/barrels.
3
- */
4
- export * from "./PlatformTestingSdkOpts.js";
@@ -1,2 +0,0 @@
1
- export declare class FeatureModule {
2
- }
@@ -1,3 +0,0 @@
1
- export declare class FeatureController {
2
- get(): string;
3
- }
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare const specsContainer: Map<string, (options: PlatformTestingSdkOpts) => void>;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testAcceptMime(options: PlatformTestingSdkOpts): void;
@@ -1,8 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare class TokenService {
3
- private _token;
4
- token(token?: string): string;
5
- isValid(token: string | undefined): RegExpMatchArray | null;
6
- }
7
- export declare function OAuth(options?: any): Function;
8
- export declare function testAuth(options: PlatformTestingSdkOpts): void;
@@ -1,3 +0,0 @@
1
- import "@tsed/ajv";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- export declare function testBodyParams(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testCache(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testChildrenControllers(options: PlatformTestingSdkOpts): void;
@@ -1,11 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare class CookiesCtrl {
3
- /**
4
- * Handle request and get auth from cookies
5
- * @param authorization
6
- */
7
- scenario1(authorization: string): {
8
- authorization: string;
9
- };
10
- }
11
- export declare function testCookies(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testCustom404(options: PlatformTestingSdkOpts): void;
@@ -1,3 +0,0 @@
1
- import "@tsed/ajv";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- export declare function testDeepQueryParams(options: PlatformTestingSdkOpts): void;
@@ -1,19 +0,0 @@
1
- import "@tsed/ajv";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- declare class CustomModel {
4
- name: string;
5
- }
6
- declare class CustomPropModel {
7
- roleItem: string;
8
- }
9
- export declare class ErrorsCtrl {
10
- scenario1(): void;
11
- scenario2(): void;
12
- scenario3(): void;
13
- scenario4(name: string): string;
14
- scenario5(model: CustomModel): CustomModel;
15
- scenario6(model: CustomPropModel): CustomPropModel;
16
- scenario7(): void;
17
- }
18
- export declare function testErrors(options: PlatformTestingSdkOpts): void;
19
- export {};
@@ -1,12 +0,0 @@
1
- import { Context } from "@tsed/common";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- export declare class MyModel {
4
- id: string;
5
- name: string;
6
- }
7
- export declare class HandlersCtrl {
8
- scenario1(id: string): MyModel;
9
- scenario2(ctx: Context, id: string): void;
10
- scenario3(id: string): Promise<any>;
11
- }
12
- export declare function testHandlers(options: PlatformTestingSdkOpts): void;
@@ -1,16 +0,0 @@
1
- import { Req } from "@tsed/common";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- export declare class HeaderParamsCtrl {
4
- /**
5
- * Handle request with a raw middleware + handler
6
- * Get Authorization from header
7
- * @param request
8
- * @param auth
9
- */
10
- scenario1(request: Req, auth: string): any;
11
- scenario2(contentType: string): {
12
- contentType: string;
13
- };
14
- testScenario3(token: string): any;
15
- }
16
- export declare function testHeaderParams(options: PlatformTestingSdkOpts): void;
@@ -1,8 +0,0 @@
1
- import { PlatformResponse } from "@tsed/common";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- export declare class HeadersCtrl {
4
- testScenario1(value: string[]): any;
5
- testScenario2(): string;
6
- testScenario3(response: PlatformResponse): string;
7
- }
8
- export declare function testHeaders(options: PlatformTestingSdkOpts): void;
@@ -1,42 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare class Resource {
3
- id: string;
4
- name: string;
5
- }
6
- export declare class BaseController<T extends {
7
- id: string;
8
- }> {
9
- resources: T[];
10
- get(id: string): Promise<any>;
11
- list(): Promise<any[]>;
12
- }
13
- export declare class ResourcesCtrl extends BaseController<Resource> {
14
- resources: {
15
- id: string;
16
- name: string;
17
- }[];
18
- get(id: string): Promise<any>;
19
- post(resource: Resource): Resource;
20
- }
21
- declare abstract class AttachmentController {
22
- getAll(parentID: string): string;
23
- }
24
- export declare class FindingsController extends AttachmentController {
25
- get(): string;
26
- }
27
- export declare abstract class TestBaseController {
28
- scenario3(search: string): {
29
- search: string;
30
- };
31
- scenario5(q: string): {
32
- data: string;
33
- };
34
- }
35
- export declare class TestChildController extends TestBaseController {
36
- scenario4(id: string): any;
37
- scenario5(s: string): {
38
- data: string;
39
- };
40
- }
41
- export declare function testInheritanceController(options: PlatformTestingSdkOpts): void;
42
- export {};
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testLocals(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testLocation(options: PlatformTestingSdkOpts): void;
@@ -1,8 +0,0 @@
1
- import "@tsed/ajv";
2
- import { MiddlewareMethods } from "@tsed/common";
3
- import { Exception } from "@tsed/exceptions";
4
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
5
- export declare class CatchErrorMiddleware implements MiddlewareMethods {
6
- use(err: Exception): void;
7
- }
8
- export declare function testMiddlewares(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testModule(options: PlatformTestingSdkOpts): void;
@@ -1,21 +0,0 @@
1
- import { PlatformMulterFile } from "@tsed/common";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- export declare class Task {
4
- id: string;
5
- title: string;
6
- }
7
- export declare class Event {
8
- id: string;
9
- tasks: Task[];
10
- }
11
- export declare class TestMulterController {
12
- uploadWithName(media: PlatformMulterFile): string;
13
- uploadWithPayload(media: PlatformMulterFile, formId: string): {
14
- file: string;
15
- formId: string;
16
- };
17
- uploadWithOptions(media: PlatformMulterFile): {
18
- file: string;
19
- };
20
- }
21
- export declare function testMulter(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testPathParams(options: PlatformTestingSdkOpts): void;
@@ -1,6 +0,0 @@
1
- import "@tsed/ajv";
2
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
- export declare class RandomStringModel {
4
- length: number;
5
- }
6
- export declare function testQueryParams(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testRedirect(options: PlatformTestingSdkOpts): void;
@@ -1,16 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare enum EnumValue {
3
- One = "one",
4
- Two = "two"
5
- }
6
- export declare class NestedEnum {
7
- value: EnumValue;
8
- }
9
- export declare class TestNestedEnum {
10
- nested: NestedEnum;
11
- }
12
- export declare class ModelGroup {
13
- id: string;
14
- groups: string;
15
- }
16
- export declare function testResponse(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testResponseFilter(options: PlatformTestingSdkOpts): void;
@@ -1,7 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare class TestRoutingController {
3
- scenario1(): string;
4
- scenario2(): string;
5
- scenario3(): string;
6
- }
7
- export declare function testRouting(options: PlatformTestingSdkOpts): void;
@@ -1,12 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare class ScopeRequestService {
3
- user: string;
4
- }
5
- export declare class ScopeRequestCtrl {
6
- scopeRequestService: ScopeRequestService;
7
- userId: string | null;
8
- constructor(scopeRequestService: ScopeRequestService);
9
- $onDestroy(): void;
10
- testPerRequest(userId: string): Promise<any>;
11
- }
12
- export declare function testScopeRequest(options: PlatformTestingSdkOpts): void;
@@ -1,16 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare class UserCreation {
3
- name: string;
4
- email: string;
5
- password: string;
6
- }
7
- export declare class User extends UserCreation {
8
- password: string;
9
- }
10
- export declare class SessionCtrl {
11
- platformName: string;
12
- connect(session: any, user: UserCreation): Promise<UserCreation>;
13
- userInfo(user: User): Promise<User>;
14
- logout(req: any): any;
15
- }
16
- export declare function testSession(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testStatics(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testStream(options: PlatformTestingSdkOpts): void;
@@ -1,2 +0,0 @@
1
- import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
- export declare function testView(options: PlatformTestingSdkOpts): void;