Tests directories refractor
This commit is contained in:
parent
db799da3d2
commit
c5d31dba56
38 changed files with 98 additions and 95 deletions
|
@ -2,9 +2,7 @@
|
|||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from './utils'
|
||||
import { runServer } from './utils/servers'
|
||||
import { makeActivityPubGetRequest } from './utils/activitypub'
|
||||
import { flushTests, killallServers, makeActivityPubGetRequest, runServer, ServerInfo, setAccessTokensToServers } from './utils'
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
setAccessTokensToServers,
|
||||
killallServers
|
||||
} from '../../utils'
|
||||
import { getVideosList, uploadVideo } from '../../utils/videos'
|
||||
import { getVideosList, uploadVideo } from '../../utils/videos/videos'
|
||||
|
||||
describe('Test services API validators', function () {
|
||||
let server
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import 'mocha'
|
||||
import * as request from 'supertest'
|
||||
import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils'
|
||||
import { addVideoCommentThread } from '../../utils/video-comments'
|
||||
import { addVideoCommentThread } from '../../utils/videos/video-comments'
|
||||
|
||||
describe('Test video comments API validator', function () {
|
||||
let pathThread: string
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Order of the tests we want to execute
|
||||
import './config'
|
||||
import './server/config'
|
||||
import './check-params'
|
||||
import './users'
|
||||
import './single-server'
|
||||
import './video-abuse'
|
||||
import './video-blacklist'
|
||||
import './video-blacklist-management'
|
||||
import './video-description'
|
||||
import './video-privacy'
|
||||
import './services'
|
||||
import './users/users'
|
||||
import './videos/single-server'
|
||||
import './videos/video-abuse'
|
||||
import './videos/video-blacklist'
|
||||
import './videos/video-blacklist-management'
|
||||
import './videos/video-description'
|
||||
import './videos/video-privacy'
|
||||
import './videos/services'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Order of the tests we want to execute
|
||||
// import './multiple-servers'
|
||||
import './video-transcoder'
|
||||
import './multiple-servers'
|
||||
import './follows'
|
||||
import './jobs'
|
||||
import './video-comments'
|
||||
import './videos/video-transcoder'
|
||||
import './videos/multiple-servers'
|
||||
import './server/follows'
|
||||
import './server/jobs'
|
||||
import './videos/video-comments'
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
flushTests,
|
||||
runServer,
|
||||
registerUser
|
||||
} from '../utils'
|
||||
} from '../../utils/index'
|
||||
|
||||
describe('Test config', function () {
|
||||
let server = null
|
|
@ -2,18 +2,21 @@
|
|||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
|
||||
import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
|
||||
|
||||
import {
|
||||
flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo,
|
||||
wait
|
||||
} from '../utils'
|
||||
import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../utils/follows'
|
||||
import { getUserAccessToken } from '../utils/login'
|
||||
import { dateIsValid, webtorrentAdd } from '../utils/miscs'
|
||||
import { createUser } from '../utils/users'
|
||||
import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments'
|
||||
import { getVideo, rateVideo, testVideoImage } from '../utils/videos'
|
||||
} from '../../utils/index'
|
||||
import { dateIsValid, webtorrentAdd } from '../../utils/miscs/miscs'
|
||||
import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows'
|
||||
import { getUserAccessToken } from '../../utils/users/login'
|
||||
import { createUser } from '../../utils/users/users'
|
||||
import {
|
||||
addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
|
||||
getVideoThreadComments
|
||||
} from '../../utils/videos/video-comments'
|
||||
import { getVideo, rateVideo, testVideoImage } from '../../utils/videos/videos'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../utils'
|
||||
import { doubleFollow } from '../utils/follows'
|
||||
import { getJobsList, getJobsListPaginationAndSort } from '../utils/jobs'
|
||||
import { flushAndRunMultipleServers } from '../utils/servers'
|
||||
import { uploadVideo } from '../utils/videos'
|
||||
import { dateIsValid } from '../utils/miscs'
|
||||
import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../../utils/index'
|
||||
import { doubleFollow } from '../../utils/server/follows'
|
||||
import { getJobsList, getJobsListPaginationAndSort } from '../../utils/server/jobs'
|
||||
import { flushAndRunMultipleServers } from '../../utils/server/servers'
|
||||
import { uploadVideo } from '../../utils/videos/videos'
|
||||
import { dateIsValid } from '../../utils/miscs/miscs'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { UserRole } from '../../../shared'
|
||||
import { UserRole } from '../../../../shared/index'
|
||||
import {
|
||||
createUser,
|
||||
flushTests,
|
||||
|
@ -26,10 +26,10 @@ import {
|
|||
updateMyUser,
|
||||
updateUser,
|
||||
uploadVideo
|
||||
} from '../utils'
|
||||
import { follow } from '../utils/follows'
|
||||
import { getMyVideos } from '../utils/videos'
|
||||
import { setAccessTokensToServers } from '../utils/login'
|
||||
} from '../../utils/index'
|
||||
import { follow } from '../../utils/server/follows'
|
||||
import { getMyVideos } from '../../utils/videos/videos'
|
||||
import { setAccessTokensToServers } from '../../utils/users/login'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -4,16 +4,19 @@ import * as chai from 'chai'
|
|||
import 'mocha'
|
||||
import { join } from 'path'
|
||||
import * as request from 'supertest'
|
||||
import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
|
||||
import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
|
||||
|
||||
import {
|
||||
addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo,
|
||||
getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage,
|
||||
updateVideo, uploadVideo, wait, webtorrentAdd
|
||||
} from '../utils'
|
||||
import { createUser } from '../utils/users'
|
||||
import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments'
|
||||
import { viewVideo } from '../utils/videos'
|
||||
} from '../../utils/index'
|
||||
import { createUser } from '../../utils/users/users'
|
||||
import {
|
||||
addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
|
||||
getVideoThreadComments
|
||||
} from '../../utils/videos/video-comments'
|
||||
import { viewVideo } from '../../utils/videos/videos'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -12,8 +12,8 @@ import {
|
|||
setAccessTokensToServers,
|
||||
killallServers,
|
||||
getOEmbed
|
||||
} from '../utils'
|
||||
import { runServer } from '../utils/servers'
|
||||
} from '../../utils/index'
|
||||
import { runServer } from '../../utils/server/servers'
|
||||
|
||||
describe('Test services', function () {
|
||||
let server: ServerInfo = null
|
|
@ -30,8 +30,8 @@ import {
|
|||
uploadVideo,
|
||||
wait,
|
||||
webtorrentAdd
|
||||
} from '../utils'
|
||||
import { viewVideo } from '../utils/videos'
|
||||
} from '../../utils/index'
|
||||
import { viewVideo } from '../../utils/videos/videos'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -13,8 +13,8 @@ import {
|
|||
setAccessTokensToServers,
|
||||
uploadVideo,
|
||||
wait
|
||||
} from '../utils'
|
||||
import { doubleFollow } from '../utils/follows'
|
||||
} from '../../utils/index'
|
||||
import { doubleFollow } from '../../utils/server/follows'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -16,8 +16,8 @@ import {
|
|||
setAccessTokensToServers,
|
||||
uploadVideo,
|
||||
wait
|
||||
} from '../utils'
|
||||
import { doubleFollow } from '../utils/follows'
|
||||
} from '../../utils/index'
|
||||
import { doubleFollow } from '../../utils/server/follows'
|
||||
|
||||
const expect = chai.expect
|
||||
const orderBy = lodash.orderBy
|
|
@ -13,8 +13,8 @@ import {
|
|||
setAccessTokensToServers,
|
||||
uploadVideo,
|
||||
wait
|
||||
} from '../utils'
|
||||
import { doubleFollow } from '../utils/follows'
|
||||
} from '../../utils/index'
|
||||
import { doubleFollow } from '../../utils/server/follows'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -17,8 +17,8 @@ import {
|
|||
updateVideoChannel,
|
||||
deleteVideoChannel,
|
||||
getVideoChannel
|
||||
} from '../utils'
|
||||
import { User } from '../../../shared'
|
||||
} from '../../utils/index'
|
||||
import { User } from '../../../../shared/index'
|
||||
|
||||
describe('Test a video channels', function () {
|
||||
let server: ServerInfo
|
|
@ -2,9 +2,12 @@
|
|||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
|
||||
import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../utils'
|
||||
import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments'
|
||||
import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
|
||||
import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
|
||||
import {
|
||||
addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
|
||||
getVideoThreadComments
|
||||
} from '../../utils/videos/video-comments'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -14,8 +14,8 @@ import {
|
|||
updateVideo,
|
||||
uploadVideo,
|
||||
wait
|
||||
} from '../utils'
|
||||
import { doubleFollow } from '../utils/follows'
|
||||
} from '../../utils/index'
|
||||
import { doubleFollow } from '../../utils/server/follows'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as chai from 'chai'
|
||||
import 'mocha'
|
||||
import { VideoPrivacy } from '../../../shared/models/videos/video-privacy.enum'
|
||||
import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
|
||||
import {
|
||||
flushAndRunMultipleServers,
|
||||
flushTests,
|
||||
|
@ -12,11 +12,11 @@ import {
|
|||
setAccessTokensToServers,
|
||||
uploadVideo,
|
||||
wait
|
||||
} from '../utils'
|
||||
import { doubleFollow } from '../utils/follows'
|
||||
import { getUserAccessToken } from '../utils/login'
|
||||
import { createUser } from '../utils/users'
|
||||
import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../utils/videos'
|
||||
} from '../../utils/index'
|
||||
import { doubleFollow } from '../../utils/server/follows'
|
||||
import { getUserAccessToken } from '../../utils/users/login'
|
||||
import { createUser } from '../../utils/users/users'
|
||||
import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos'
|
||||
|
||||
const expect = chai.expect
|
||||
|
|
@ -15,7 +15,7 @@ import {
|
|||
killallServers,
|
||||
webtorrentAdd,
|
||||
getVideo
|
||||
} from '../utils'
|
||||
} from '../../utils/index'
|
||||
|
||||
describe('Test video transcoding', function () {
|
||||
let servers: ServerInfo[] = []
|
|
@ -1,6 +1,6 @@
|
|||
import { exec } from 'child_process'
|
||||
|
||||
import { ServerInfo } from './servers'
|
||||
import { ServerInfo } from '../server/servers'
|
||||
|
||||
function getEnvCli (server?: ServerInfo) {
|
||||
return `NODE_ENV=test NODE_APP_INSTANCE=${server.serverNumber}`
|
|
@ -1,15 +1,15 @@
|
|||
export * from './activitypub'
|
||||
export * from './cli'
|
||||
export * from './clients'
|
||||
export * from './config'
|
||||
export * from './login'
|
||||
export * from './miscs'
|
||||
export * from './follows'
|
||||
export * from './requests'
|
||||
export * from './servers'
|
||||
export * from './services'
|
||||
export * from './users'
|
||||
export * from './video-abuses'
|
||||
export * from './video-blacklist'
|
||||
export * from './video-channels'
|
||||
export * from './videos'
|
||||
export * from './server/activitypub'
|
||||
export * from './cli/cli'
|
||||
export * from './server/clients'
|
||||
export * from './server/config'
|
||||
export * from './users/login'
|
||||
export * from './miscs/miscs'
|
||||
export * from './server/follows'
|
||||
export * from './requests/requests'
|
||||
export * from './server/servers'
|
||||
export * from './videos/services'
|
||||
export * from './users/users'
|
||||
export * from './videos/video-abuses'
|
||||
export * from './videos/video-blacklist'
|
||||
export * from './videos/video-channels'
|
||||
export * from './videos/videos'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as request from 'supertest'
|
||||
import { wait } from './miscs'
|
||||
import { wait } from '../miscs/miscs'
|
||||
import { ServerInfo } from './servers'
|
||||
|
||||
function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string) {
|
|
@ -1,6 +1,6 @@
|
|||
import * as request from 'supertest'
|
||||
|
||||
import { ServerInfo } from './servers'
|
||||
import { ServerInfo } from '../server/servers'
|
||||
|
||||
type Client = { id: string, secret: string }
|
||||
type User = { username: string, password: string }
|
|
@ -1,6 +1,6 @@
|
|||
import * as request from 'supertest'
|
||||
|
||||
import { UserRole } from '../../../shared'
|
||||
import { UserRole } from '../../../../shared/index'
|
||||
|
||||
function createUser (
|
||||
url: string,
|
|
@ -1,13 +1,9 @@
|
|||
import { readFile } from 'fs'
|
||||
import * as request from 'supertest'
|
||||
import { join, isAbsolute } from 'path'
|
||||
import * as parseTorrent from 'parse-torrent'
|
||||
|
||||
import { makeGetRequest } from './requests'
|
||||
import { readFilePromise } from './miscs'
|
||||
import { ServerInfo } from './servers'
|
||||
import { getMyUserInformation } from './users'
|
||||
import { VideoPrivacy } from '../../../shared'
|
||||
import { isAbsolute, join } from 'path'
|
||||
import * as request from 'supertest'
|
||||
import { getMyUserInformation, makeGetRequest, readFilePromise, ServerInfo } from '../'
|
||||
import { VideoPrivacy } from '../../../../shared/models/videos'
|
||||
|
||||
type VideoAttributes = {
|
||||
name?: string
|
Loading…
Reference in a new issue