Fix tests
authorChocobozzz <me@florianbigard.com>
Thu, 18 Jun 2020 11:38:20 +0000 (13:38 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 18 Jun 2020 11:39:13 +0000 (13:39 +0200)
scripts/ci.sh
server/tests/api/ci-4.sh
server/typings/express.d.ts [deleted file]
server/typings/express/index.d.ts [new file with mode: 0644]
tsconfig.json

index 7854d88fc7b78131c69392cb3dff4f8d6f754106..f75e457fdf69335c0d49b427b8344626281835a1 100755 (executable)
@@ -13,7 +13,7 @@ perl -0777 -i  -pe 's#proxy:(\n\s+)enabled: false\n\s+url: ""#proxy:$1enabled: t
 
 if [ "$1" = "misc" ]; then
     npm run build -- --light
-    mocha --timeout 5000 --exit --require ts-node/register --require tsconfig-paths/register --bail server/tests/client.ts \
+    mocha --timeout 5000 --exit --require ts-node/register --files --require tsconfig-paths/register --bail server/tests/client.ts \
         server/tests/feeds/index.ts \
         server/tests/misc-endpoints.ts \
         server/tests/helpers/index.ts \
index 7d83cbdfcc64c7d97e9edf6af48dc69a8bdada05..e71b9b1546195b499c0413c99f6f053e1c5c04d1 100644 (file)
@@ -6,5 +6,5 @@ redundancyFiles=$(find server/tests/api/redundancy -type f | grep -v index.ts |
 activitypubFiles=$(find server/tests/api/activitypub -type f | grep -v index.ts | xargs echo)
 
 MOCHA_PARALLEL=true npm run mocha -- --parallel --jobs $1 --timeout 30000 --exit \
-  --require ts-node/register --require tsconfig-paths/register --bail \
+  --require ts-node/register --files --require tsconfig-paths/register --bail \
   $redundancyFiles $activitypubFiles
diff --git a/server/typings/express.d.ts b/server/typings/express.d.ts
deleted file mode 100644 (file)
index 451bf91..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-import { RegisteredPlugin } from '../lib/plugins/plugin-manager'
-import {
-  MAccountDefault,
-  MActorAccountChannelId,
-  MActorFollowActorsDefault,
-  MActorFollowActorsDefaultSubscription,
-  MActorFull,
-  MChannelAccountDefault,
-  MComment,
-  MCommentOwnerVideoReply,
-  MUserDefault,
-  MVideoAbuse,
-  MVideoBlacklist,
-  MVideoCaptionVideo,
-  MVideoFullLight,
-  MVideoIdThumbnail,
-  MVideoRedundancyVideo,
-  MVideoShareActor,
-  MVideoThumbnail,
-  MVideoWithRights
-} from '../types/models'
-import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from '../types/models/video/video-playlist'
-import { MVideoImportDefault } from '@server/types/models/video/video-import'
-import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/types/models'
-import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element'
-import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate'
-import { MVideoChangeOwnershipFull } from '../types/models/video/video-change-ownership'
-import { MPlugin, MServer } from '@server/types/models/server'
-import { MServerBlocklist } from '../types/models/server/server-blocklist'
-import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'
-import { UserRole } from '@shared/models'
-import { RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model'
-
-declare module 'express' {
-  export interface Request {
-    query: any
-  }
-
-  interface Response {
-
-    locals: {
-      bypassLogin?: {
-        bypass: boolean
-        pluginName: string
-        authName?: string
-        user: {
-          username: string
-          email: string
-          displayName: string
-          role: UserRole
-        }
-      }
-
-      refreshTokenAuthName?: string
-
-      explicitLogout: boolean
-
-      videoAll?: MVideoFullLight
-      onlyImmutableVideo?: MVideoImmutable
-      onlyVideo?: MVideoThumbnail
-      onlyVideoWithRights?: MVideoWithRights
-      videoId?: MVideoIdThumbnail
-
-      videoShare?: MVideoShareActor
-
-      videoFile?: MVideoFile
-
-      videoImport?: MVideoImportDefault
-
-      videoBlacklist?: MVideoBlacklist
-
-      videoCaption?: MVideoCaptionVideo
-
-      videoAbuse?: MVideoAbuse
-
-      videoStreamingPlaylist?: MStreamingPlaylist
-
-      videoChannel?: MChannelAccountDefault
-
-      videoPlaylistFull?: MVideoPlaylistFull
-      videoPlaylistSummary?: MVideoPlaylistFullSummary
-
-      videoPlaylistElement?: MVideoPlaylistElement
-      videoPlaylistElementAP?: MVideoPlaylistElementVideoUrlPlaylistPrivacy
-
-      accountVideoRate?: MAccountVideoRateAccountVideo
-
-      videoCommentFull?: MCommentOwnerVideoReply
-      videoCommentThread?: MComment
-
-      follow?: MActorFollowActorsDefault
-      subscription?: MActorFollowActorsDefaultSubscription
-
-      nextOwner?: MAccountDefault
-      videoChangeOwnership?: MVideoChangeOwnershipFull
-
-      account?: MAccountDefault
-
-      actorUrl?: MActorUrl
-      actorFull?: MActorFull
-
-      user?: MUserDefault
-
-      server?: MServer
-
-      videoRedundancy?: MVideoRedundancyVideo
-
-      accountBlock?: MAccountBlocklist
-      serverBlock?: MServerBlocklist
-
-      oauth?: {
-        token: MOAuthTokenUser
-      }
-
-      signature?: {
-        actor: MActorAccountChannelId
-      }
-
-      authenticated?: boolean
-
-      registeredPlugin?: RegisteredPlugin
-
-      externalAuth?: RegisterServerAuthExternalOptions
-
-      plugin?: MPlugin
-    }
-  }
-}
diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts
new file mode 100644 (file)
index 0000000..ad32123
--- /dev/null
@@ -0,0 +1,128 @@
+import { RegisteredPlugin } from '../../lib/plugins/plugin-manager'
+import {
+  MAccountDefault,
+  MActorAccountChannelId,
+  MActorFollowActorsDefault,
+  MActorFollowActorsDefaultSubscription,
+  MActorFull,
+  MChannelAccountDefault,
+  MComment,
+  MCommentOwnerVideoReply,
+  MUserDefault,
+  MVideoAbuse,
+  MVideoBlacklist,
+  MVideoCaptionVideo,
+  MVideoFullLight,
+  MVideoIdThumbnail,
+  MVideoRedundancyVideo,
+  MVideoShareActor,
+  MVideoThumbnail,
+  MVideoWithRights
+} from '../../types/models'
+import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from '../../types/models/video/video-playlist'
+import { MVideoImportDefault } from '@server/types/models/video/video-import'
+import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/types/models'
+import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element'
+import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate'
+import { MVideoChangeOwnershipFull } from '../../types/models/video/video-change-ownership'
+import { MPlugin, MServer } from '@server/types/models/server'
+import { MServerBlocklist } from '../../types/models/server/server-blocklist'
+import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token'
+import { UserRole } from '@shared/models'
+import { RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model'
+
+declare module 'express' {
+  export interface Request {
+    query: any
+  }
+
+  interface Response {
+
+    locals: {
+      bypassLogin?: {
+        bypass: boolean
+        pluginName: string
+        authName?: string
+        user: {
+          username: string
+          email: string
+          displayName: string
+          role: UserRole
+        }
+      }
+
+      refreshTokenAuthName?: string
+
+      explicitLogout: boolean
+
+      videoAll?: MVideoFullLight
+      onlyImmutableVideo?: MVideoImmutable
+      onlyVideo?: MVideoThumbnail
+      onlyVideoWithRights?: MVideoWithRights
+      videoId?: MVideoIdThumbnail
+
+      videoShare?: MVideoShareActor
+
+      videoFile?: MVideoFile
+
+      videoImport?: MVideoImportDefault
+
+      videoBlacklist?: MVideoBlacklist
+
+      videoCaption?: MVideoCaptionVideo
+
+      videoAbuse?: MVideoAbuse
+
+      videoStreamingPlaylist?: MStreamingPlaylist
+
+      videoChannel?: MChannelAccountDefault
+
+      videoPlaylistFull?: MVideoPlaylistFull
+      videoPlaylistSummary?: MVideoPlaylistFullSummary
+
+      videoPlaylistElement?: MVideoPlaylistElement
+      videoPlaylistElementAP?: MVideoPlaylistElementVideoUrlPlaylistPrivacy
+
+      accountVideoRate?: MAccountVideoRateAccountVideo
+
+      videoCommentFull?: MCommentOwnerVideoReply
+      videoCommentThread?: MComment
+
+      follow?: MActorFollowActorsDefault
+      subscription?: MActorFollowActorsDefaultSubscription
+
+      nextOwner?: MAccountDefault
+      videoChangeOwnership?: MVideoChangeOwnershipFull
+
+      account?: MAccountDefault
+
+      actorUrl?: MActorUrl
+      actorFull?: MActorFull
+
+      user?: MUserDefault
+
+      server?: MServer
+
+      videoRedundancy?: MVideoRedundancyVideo
+
+      accountBlock?: MAccountBlocklist
+      serverBlock?: MServerBlocklist
+
+      oauth?: {
+        token: MOAuthTokenUser
+      }
+
+      signature?: {
+        actor: MActorAccountChannelId
+      }
+
+      authenticated?: boolean
+
+      registeredPlugin?: RegisteredPlugin
+
+      externalAuth?: RegisterServerAuthExternalOptions
+
+      plugin?: MPlugin
+    }
+  }
+}
index d305722c465456b57b7143ef56845b0f8b8b46a4..aa129c1d9e332c92e0c3dfab0df676a71764f757 100644 (file)
@@ -28,6 +28,7 @@
       "@shared/*": [ "shared/*" ]
     }
   },
+  "include": [ "." ],
   "exclude": [
     "server/tools/",
     "node_modules",