Peertube: Not using test/utils in tools scripts

Created on 22 Oct 2018  路  6Comments  路  Source: Chocobozzz/PeerTube

We shouldn't use server/tests/utils which are intended for tests inside of server/tools scripts.

We should keep tests for tests and tools for tools, maybe we can move some of this functionality to shared since it's shared between tools and tests.

example 1 server/tools/peertube-get-access-token.ts:

import {
  getClient,
  serverLogin,
  Server,
  Client,
  User
} from '../tests/utils/index'

example 2 server/tools/peertube-import-videos.ts:

import { getClient, getVideoCategories, login, searchVideoWithSort, uploadVideo } from '../tests/utils'

example 3 server/tools/peertube-upload.ts:

import { uploadVideo } from '../tests/utils/index'

All these need to move to shared/ so that we don't use utils intended for tests inside of tools.

Type

All 6 comments

Hey can i take this? Thanks!

@buoyantair You can probably take the issue - unless OP is already working on it ? In the meantime I'm assigning it to you then :)

I've been busy with other stuff, go ahead please solve it

@rigelk I made the PR ^ But I have some issues with testing async functions I guess. Can you look into it?

Guys?

@buoyantair I don't have time to review your PR right now - will do tomorrow

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filmaidykai picture filmaidykai  路  3Comments

Angedestenebres picture Angedestenebres  路  3Comments

Jorropo picture Jorropo  路  3Comments

XenonFiber picture XenonFiber  路  3Comments

milleniumbug picture milleniumbug  路  3Comments