diff options
author | Kimsible <kimsible@users.noreply.github.com> | 2021-04-28 18:26:26 +0200 |
---|---|---|
committer | Kimsible <kimsible@users.noreply.github.com> | 2021-05-05 11:47:03 +0200 |
commit | 08ac081b37cd6115634e8951608116fe0f13032b (patch) | |
tree | da5c1b338705686093c8fea26e552b16fda7c2cb /shared/extra-utils/actors | |
parent | 1e37d32f4bdc51045cd85d01ea1035fd53e0d32c (diff) | |
download | PeerTube-08ac081b37cd6115634e8951608116fe0f13032b.tar.gz PeerTube-08ac081b37cd6115634e8951608116fe0f13032b.tar.zst PeerTube-08ac081b37cd6115634e8951608116fe0f13032b.zip |
Add test for API actors route
Diffstat (limited to 'shared/extra-utils/actors')
-rw-r--r-- | shared/extra-utils/actors/actors.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shared/extra-utils/actors/actors.ts b/shared/extra-utils/actors/actors.ts new file mode 100644 index 000000000..4a4aba775 --- /dev/null +++ b/shared/extra-utils/actors/actors.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | ||
2 | |||
3 | import { makeGetRequest } from '../requests/requests' | ||
4 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
5 | |||
6 | function getActor (url: string, actorName: string, statusCodeExpected = HttpStatusCode.OK_200) { | ||
7 | const path = '/api/v1/actors/' + actorName | ||
8 | |||
9 | return makeGetRequest({ | ||
10 | url, | ||
11 | path, | ||
12 | statusCodeExpected | ||
13 | }) | ||
14 | } | ||
15 | |||
16 | export { | ||
17 | getActor | ||
18 | } | ||