summaryrefslogtreecommitdiff
path: root/packages/backend/test/e2e/timelines.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/test/e2e/timelines.ts')
-rw-r--r--packages/backend/test/e2e/timelines.ts28
1 files changed, 9 insertions, 19 deletions
diff --git a/packages/backend/test/e2e/timelines.ts b/packages/backend/test/e2e/timelines.ts
index cb9558b416..88f89c4a6f 100644
--- a/packages/backend/test/e2e/timelines.ts
+++ b/packages/backend/test/e2e/timelines.ts
@@ -6,12 +6,8 @@
// How to run:
// pnpm jest -- e2e/timelines.ts
-process.env.NODE_ENV = 'test';
-process.env.FORCE_FOLLOW_REMOTE_USER_FOR_TESTING = 'true';
-
import * as assert from 'assert';
-import { api, post, randomString, signup, sleep, startServer, uploadUrl } from '../utils.js';
-import type { INestApplicationContext } from '@nestjs/common';
+import { api, post, randomString, sendEnvUpdateRequest, signup, sleep, uploadUrl } from '../utils.js';
function genHost() {
return randomString() + '.example.com';
@@ -21,16 +17,6 @@ function waitForPushToTl() {
return sleep(500);
}
-let app: INestApplicationContext;
-
-beforeAll(async () => {
- app = await startServer();
-}, 1000 * 60 * 2);
-
-afterAll(async () => {
- await app.close();
-});
-
describe('Timelines', () => {
describe('Home TL', () => {
test.concurrent('自分の visibility: followers なノートが含まれる', async () => {
@@ -334,8 +320,9 @@ describe('Timelines', () => {
test.concurrent('フォローしているリモートユーザーのノートが含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]);
+ await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' });
await api('/following/create', { userId: bob.id }, alice);
- await sleep(1000);
+
const bobNote = await post(bob, { text: 'hi' });
await waitForPushToTl();
@@ -348,8 +335,9 @@ describe('Timelines', () => {
test.concurrent('フォローしているリモートユーザーの visibility: home なノートが含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]);
+ await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' });
await api('/following/create', { userId: bob.id }, alice);
- await sleep(1000);
+
const bobNote = await post(bob, { text: 'hi', visibility: 'home' });
await waitForPushToTl();
@@ -762,8 +750,9 @@ describe('Timelines', () => {
test.concurrent('フォローしているリモートユーザーのノートが含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]);
+ await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' });
await api('/following/create', { userId: bob.id }, alice);
- await sleep(1000);
+
const bobNote = await post(bob, { text: 'hi' });
await waitForPushToTl();
@@ -776,8 +765,9 @@ describe('Timelines', () => {
test.concurrent('フォローしているリモートユーザーの visibility: home なノートが含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]);
+ await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' });
await api('/following/create', { userId: bob.id }, alice);
- await sleep(1000);
+
const bobNote = await post(bob, { text: 'hi', visibility: 'home' });
await waitForPushToTl();