@tsed/platform-test-sdk 7.70.1 → 7.71.0

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 (106) hide show
  1. package/.barrelsby.json +5 -0
  2. package/lib/cjs/components/PlatformTestSdk.js +2 -2
  3. package/lib/cjs/components/PlatformTestSdk.js.map +1 -1
  4. package/lib/cjs/index.js +40 -39
  5. package/lib/cjs/index.js.map +1 -1
  6. package/lib/cjs/interfaces/index.js +4 -4
  7. package/lib/cjs/interfaces/index.js.map +1 -1
  8. package/lib/cjs/modules/feature/FeatureModule.js +2 -2
  9. package/lib/cjs/modules/feature/FeatureModule.js.map +1 -1
  10. package/lib/cjs/tests/exports.js +58 -58
  11. package/lib/cjs/tests/exports.js.map +1 -1
  12. package/lib/cjs/tests/testErrors.js +6 -6
  13. package/lib/cjs/tests/testErrors.js.map +1 -1
  14. package/lib/cjs/tests/testModule.js +2 -2
  15. package/lib/cjs/tests/testModule.js.map +1 -1
  16. package/lib/cjs/tests/testMulter.js +1 -3
  17. package/lib/cjs/tests/testMulter.js.map +1 -1
  18. package/lib/cjs/tests/testResponse.js +0 -1
  19. package/lib/cjs/tests/testResponse.js.map +1 -1
  20. package/lib/cjs/tests/testStream.js +1 -3
  21. package/lib/cjs/tests/testStream.js.map +1 -1
  22. package/lib/esm/components/PlatformTestSdk.js.map +1 -1
  23. package/lib/esm/index.js +3 -2
  24. package/lib/esm/index.js.map +1 -1
  25. package/lib/esm/interfaces/index.js +1 -1
  26. package/lib/esm/interfaces/index.js.map +1 -1
  27. package/lib/esm/modules/feature/FeatureModule.js.map +1 -1
  28. package/lib/esm/tests/exports.js.map +1 -1
  29. package/lib/esm/tests/testErrors.js.map +1 -1
  30. package/lib/esm/tests/testModule.js.map +1 -1
  31. package/lib/esm/tests/testMulter.js +2 -4
  32. package/lib/esm/tests/testMulter.js.map +1 -1
  33. package/lib/esm/tests/testResponse.js +0 -1
  34. package/lib/esm/tests/testResponse.js.map +1 -1
  35. package/lib/esm/tests/testStream.js +1 -3
  36. package/lib/esm/tests/testStream.js.map +1 -1
  37. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  38. package/lib/tsconfig.tsbuildinfo +1 -1
  39. package/lib/types/components/PlatformTestSdk.d.ts +1 -1
  40. package/lib/types/index.d.ts +38 -37
  41. package/lib/types/interfaces/index.d.ts +2 -2
  42. package/lib/types/tests/exports.d.ts +1 -1
  43. package/lib/types/tests/testAcceptMime.d.ts +1 -1
  44. package/lib/types/tests/testAuth.d.ts +1 -1
  45. package/lib/types/tests/testBodyParams.d.ts +1 -1
  46. package/lib/types/tests/testCache.d.ts +1 -1
  47. package/lib/types/tests/testChildrenControllers.d.ts +1 -1
  48. package/lib/types/tests/testCookies.d.ts +1 -1
  49. package/lib/types/tests/testCustom404.d.ts +1 -1
  50. package/lib/types/tests/testDeepQueryParams.d.ts +1 -1
  51. package/lib/types/tests/testErrors.d.ts +1 -1
  52. package/lib/types/tests/testHandlers.d.ts +1 -1
  53. package/lib/types/tests/testHeaderParams.d.ts +1 -1
  54. package/lib/types/tests/testHeaders.d.ts +1 -1
  55. package/lib/types/tests/testInheritanceController.d.ts +1 -1
  56. package/lib/types/tests/testLocals.d.ts +1 -1
  57. package/lib/types/tests/testLocation.d.ts +1 -1
  58. package/lib/types/tests/testMiddlewares.d.ts +1 -1
  59. package/lib/types/tests/testModule.d.ts +1 -1
  60. package/lib/types/tests/testMulter.d.ts +1 -1
  61. package/lib/types/tests/testPathParams.d.ts +1 -1
  62. package/lib/types/tests/testQueryParams.d.ts +1 -1
  63. package/lib/types/tests/testRedirect.d.ts +1 -1
  64. package/lib/types/tests/testResponse.d.ts +1 -1
  65. package/lib/types/tests/testResponseFilter.d.ts +1 -1
  66. package/lib/types/tests/testRouting.d.ts +1 -1
  67. package/lib/types/tests/testScopeRequest.d.ts +1 -1
  68. package/lib/types/tests/testSession.d.ts +1 -1
  69. package/lib/types/tests/testStatics.d.ts +1 -1
  70. package/lib/types/tests/testStream.d.ts +1 -1
  71. package/lib/types/tests/testView.d.ts +1 -1
  72. package/package.json +17 -16
  73. package/src/components/PlatformTestSdk.ts +2 -2
  74. package/src/index.ts +38 -38
  75. package/src/interfaces/index.ts +2 -3
  76. package/src/modules/feature/FeatureModule.ts +1 -1
  77. package/src/tests/exports.ts +30 -30
  78. package/src/tests/testAcceptMime.ts +1 -1
  79. package/src/tests/testAuth.ts +1 -1
  80. package/src/tests/testBodyParams.ts +1 -1
  81. package/src/tests/testCache.ts +1 -1
  82. package/src/tests/testChildrenControllers.ts +1 -1
  83. package/src/tests/testCookies.ts +1 -1
  84. package/src/tests/testCustom404.ts +1 -1
  85. package/src/tests/testDeepQueryParams.ts +1 -1
  86. package/src/tests/testErrors.ts +3 -3
  87. package/src/tests/testHandlers.ts +1 -1
  88. package/src/tests/testHeaderParams.ts +1 -1
  89. package/src/tests/testHeaders.ts +1 -1
  90. package/src/tests/testInheritanceController.ts +1 -1
  91. package/src/tests/testLocals.ts +1 -1
  92. package/src/tests/testLocation.ts +1 -1
  93. package/src/tests/testMiddlewares.ts +1 -1
  94. package/src/tests/testModule.ts +2 -2
  95. package/src/tests/testMulter.ts +2 -4
  96. package/src/tests/testPathParams.ts +1 -1
  97. package/src/tests/testQueryParams.ts +1 -1
  98. package/src/tests/testRedirect.ts +1 -1
  99. package/src/tests/testResponse.ts +1 -3
  100. package/src/tests/testResponseFilter.ts +1 -1
  101. package/src/tests/testRouting.ts +1 -1
  102. package/src/tests/testScopeRequest.ts +1 -1
  103. package/src/tests/testSession.ts +1 -1
  104. package/src/tests/testStatics.ts +1 -1
  105. package/src/tests/testStream.ts +3 -4
  106. package/src/tests/testView.ts +1 -1
@@ -4,9 +4,9 @@ import {Env} from "@tsed/core";
4
4
  import {BadRequest, InternalServerError} from "@tsed/exceptions";
5
5
  import {Description, Name, Required, Returns, Summary} from "@tsed/schema";
6
6
  import SuperTest from "supertest";
7
- import {CustomBadRequest} from "../errors/CustomBadRequest";
8
- import {CustomInternalError} from "../errors/CustomInternalError";
9
- import {PlatformTestingSdkOpts} from "../interfaces";
7
+ import {CustomBadRequest} from "../errors/CustomBadRequest.js";
8
+ import {CustomInternalError} from "../errors/CustomInternalError.js";
9
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
10
10
 
11
11
  class CustomModel {
12
12
  @Required() name: string;
@@ -1,7 +1,7 @@
1
1
  import {Context, Controller, Get, PathParams, PlatformTest} from "@tsed/common";
2
2
  import {Property, Required, Title} from "@tsed/schema";
3
3
  import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces";
4
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
5
 
6
6
  export class MyModel {
7
7
  @Title("ID")
@@ -1,7 +1,7 @@
1
1
  import {Context, Controller, Get, HeaderParams, Locals, Middleware, PlatformTest, Post, Req, Use} from "@tsed/common";
2
2
  import {Enum, Required} from "@tsed/schema";
3
3
  import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces";
4
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
5
 
6
6
  @Middleware()
7
7
  class SetId {
@@ -1,7 +1,7 @@
1
1
  import {BodyParams, Controller, Get, PlatformResponse, PlatformTest, Res} from "@tsed/common";
2
2
  import {Returns} from "@tsed/schema";
3
3
  import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces";
4
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
5
 
6
6
  @Controller("/headers")
7
7
  export class HeadersCtrl {
@@ -2,7 +2,7 @@ import {BodyParams, Controller, Get, Middleware, PathParams, PlatformTest, Post,
2
2
  import {NotFound} from "@tsed/exceptions";
3
3
  import {Description, MaxLength, MinLength, Property, Returns, Summary} from "@tsed/schema";
4
4
  import SuperTest from "supertest";
5
- import {PlatformTestingSdkOpts} from "../interfaces";
5
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
6
6
 
7
7
  export class Resource {
8
8
  @Property()
@@ -1,6 +1,6 @@
1
1
  import {Context, Controller, Get, Locals, Middleware, Next, PlatformContext, PlatformTest, Req, Request, Res, Use} from "@tsed/common";
2
2
  import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces";
3
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
4
 
5
5
  @Middleware()
6
6
  class LocalsMiddleware {
@@ -1,7 +1,7 @@
1
1
  import {Controller, Get, PlatformTest} from "@tsed/common";
2
2
  import SuperTest from "supertest";
3
3
  import {Location} from "@tsed/schema";
4
- import {PlatformTestingSdkOpts} from "../interfaces";
4
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
5
 
6
6
  @Controller("/location")
7
7
  class LocationCtrl {
@@ -14,7 +14,7 @@ import {
14
14
  } from "@tsed/common";
15
15
  import {BadRequest, Exception, Unauthorized} from "@tsed/exceptions";
16
16
  import SuperTest from "supertest";
17
- import {PlatformTestingSdkOpts} from "../interfaces";
17
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
18
18
 
19
19
  @Middleware()
20
20
  class BeforeCustomMiddleware {
@@ -1,7 +1,7 @@
1
1
  import {Controller, Get, PlatformTest} from "@tsed/common";
2
2
  import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces";
4
- import {FeatureModule} from "../modules/feature/FeatureModule";
3
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
+ import {FeatureModule} from "../modules/feature/FeatureModule.js";
5
5
 
6
6
  @Controller("/root")
7
7
  class TestRootCtrl {
@@ -1,14 +1,12 @@
1
1
  import {BodyParams, Controller, MulterOptions, MultipartFile, PlatformMulterFile, PlatformTest} from "@tsed/common";
2
2
  import {CollectionOf, Post, Property, Required, Status} from "@tsed/schema";
3
- import filedirname from "filedirname";
4
3
  import multer, {FileFilterCallback} from "multer";
5
4
  import {dirname, join} from "path";
6
5
  import readPkgUp from "read-pkg-up";
7
6
  import SuperTest from "supertest";
8
- import {PlatformTestingSdkOpts} from "../interfaces";
7
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
9
8
 
10
- // FIXME remove when esm is ready
11
- const [, rootDir] = filedirname();
9
+ const rootDir = __dirname; // automatically replaced by import.meta.dirname on build
12
10
 
13
11
  export class Task {
14
12
  @Property()
@@ -1,7 +1,7 @@
1
1
  import {Context, Controller, Get, PathParams, PlatformTest, Post} from "@tsed/common";
2
2
  import {Pattern} from "@tsed/schema";
3
3
  import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces";
4
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
5
 
6
6
  @Controller("/path-params")
7
7
  class TestPathParamsCtrl {
@@ -2,7 +2,7 @@ import "@tsed/ajv";
2
2
  import {Controller, Get, PlatformTest, QueryParams} from "@tsed/common";
3
3
  import {Maximum, Minimum, Required} from "@tsed/schema";
4
4
  import SuperTest from "supertest";
5
- import {PlatformTestingSdkOpts} from "../interfaces";
5
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
6
6
 
7
7
  export class RandomStringModel {
8
8
  @Maximum(250)
@@ -1,6 +1,6 @@
1
1
  import {Context, Controller, Get, Location, PlatformTest, Redirect} from "@tsed/common";
2
2
  import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces";
3
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
4
 
5
5
  @Controller("/redirect")
6
6
  class RedirectCtrl {
@@ -4,9 +4,7 @@ import axios from "axios";
4
4
  import {of} from "rxjs";
5
5
  import {agent, SuperAgentStatic} from "superagent";
6
6
  import SuperTest from "supertest";
7
- import {PlatformTestingSdkOpts} from "../interfaces";
8
-
9
- // FIXME remove when esm is ready
7
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
10
8
 
11
9
  class Base {
12
10
  @Ignore()
@@ -1,7 +1,7 @@
1
1
  import {Controller, Get, PlatformContext, PlatformTest, ResponseFilter, ResponseFilterMethods} from "@tsed/common";
2
2
  import {Property, Returns} from "@tsed/schema";
3
3
  import SuperTest from "supertest";
4
- import {PlatformTestingSdkOpts} from "../interfaces";
4
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
5
5
 
6
6
  class ResponseFilterModel {
7
7
  @Property()
@@ -1,6 +1,6 @@
1
1
  import {Controller, Get, PlatformTest, Put} from "@tsed/common";
2
2
  import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces";
3
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
4
 
5
5
  const stub = jest.fn();
6
6
 
@@ -1,6 +1,6 @@
1
1
  import {Controller, Get, PathParams, PlatformTest, ProviderScope, Scope, Service} from "@tsed/common";
2
2
  import SuperTest from "supertest";
3
- import {PlatformTestingSdkOpts} from "../interfaces";
3
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
4
4
 
5
5
  @Service()
6
6
  @Scope(ProviderScope.REQUEST)
@@ -3,7 +3,7 @@ import {NotFound} from "@tsed/exceptions";
3
3
  import {Allow, Email, Ignore, MinLength, Property, Required, Returns} from "@tsed/schema";
4
4
  import SuperTest from "supertest";
5
5
  import {promisify} from "util";
6
- import {PlatformTestingSdkOpts} from "../interfaces";
6
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
7
7
 
8
8
  export class UserCreation {
9
9
  @Property()
@@ -4,7 +4,7 @@ import {Configuration} from "@tsed/di";
4
4
  import {PlatformRouter} from "@tsed/platform-router";
5
5
  import {readFileSync} from "fs";
6
6
  import SuperTest from "supertest";
7
- import {PlatformTestingSdkOpts} from "../interfaces";
7
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
8
8
 
9
9
  @Controller("/statics")
10
10
  class CustomStaticsCtrl {
@@ -1,12 +1,11 @@
1
1
  import {Controller, Get, PlatformTest} from "@tsed/common";
2
2
  import {ContentType} from "@tsed/schema";
3
- import filedirname from "filedirname";
4
3
  import {createReadStream} from "fs";
5
4
  import {join} from "path";
6
5
  import SuperTest from "supertest";
7
- import {PlatformTestingSdkOpts} from "../interfaces";
8
- // FIXME remove when esm is ready
9
- const [, rootDir] = filedirname();
6
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
7
+
8
+ const rootDir = __dirname; // automatically replaced by import.meta.dirname on build
10
9
 
11
10
  @Controller("/stream")
12
11
  class TestStreamCtrl {
@@ -2,7 +2,7 @@ import {Controller, Get, Locals, Middleware, PlatformTest, UseBefore} from "@tse
2
2
  import {EOL} from "os";
3
3
  import SuperTest from "supertest";
4
4
  import {View} from "@tsed/platform-views";
5
- import {PlatformTestingSdkOpts} from "../interfaces";
5
+ import {PlatformTestingSdkOpts} from "../interfaces/index.js";
6
6
 
7
7
  @Middleware()
8
8
  class LocalsMiddleware {