From a43398ce1dfc65d4649e56371321c43713c756ff Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Mar 2023 20:57:01 +0900 Subject: [PATCH] refactor(test): rename variable for INestApplicationContext --- packages/backend/test/e2e/2fa.ts | 6 +++--- packages/backend/test/e2e/api-visibility.ts | 6 +++--- packages/backend/test/e2e/api.ts | 6 +++--- packages/backend/test/e2e/block.ts | 6 +++--- packages/backend/test/e2e/endpoints.ts | 6 +++--- packages/backend/test/e2e/fetch-resource.ts | 6 +++--- packages/backend/test/e2e/ff-visibility.ts | 6 +++--- packages/backend/test/e2e/mute.ts | 6 +++--- packages/backend/test/e2e/note.ts | 6 +++--- packages/backend/test/e2e/renote-mute.ts | 6 +++--- packages/backend/test/e2e/streaming.ts | 6 +++--- packages/backend/test/e2e/thread-mute.ts | 6 +++--- packages/backend/test/e2e/user-notes.ts | 6 +++--- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/packages/backend/test/e2e/2fa.ts b/packages/backend/test/e2e/2fa.ts index b5e4e9cf5c..0addb430c9 100644 --- a/packages/backend/test/e2e/2fa.ts +++ b/packages/backend/test/e2e/2fa.ts @@ -9,7 +9,7 @@ import { signup, api, post, react, startServer, waitFire } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('2要素認証', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let alice: unknown; const config = loadConfig(); @@ -163,12 +163,12 @@ describe('2要素認証', () => { }; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username, password }); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); test('が設定でき、OTPでログインできる。', async () => { diff --git a/packages/backend/test/e2e/api-visibility.ts b/packages/backend/test/e2e/api-visibility.ts index 4e162f42d0..3af0d35182 100644 --- a/packages/backend/test/e2e/api-visibility.ts +++ b/packages/backend/test/e2e/api-visibility.ts @@ -5,14 +5,14 @@ import { signup, api, post, startServer } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('API visibility', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; beforeAll(async () => { - p = await startServer(); + app = await startServer(); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); describe('Note visibility', () => { diff --git a/packages/backend/test/e2e/api.ts b/packages/backend/test/e2e/api.ts index 6ceccf66eb..a46f336a70 100644 --- a/packages/backend/test/e2e/api.ts +++ b/packages/backend/test/e2e/api.ts @@ -5,20 +5,20 @@ import { signup, api, startServer } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('API', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let alice: any; let bob: any; let carol: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); describe('General validation', () => { diff --git a/packages/backend/test/e2e/block.ts b/packages/backend/test/e2e/block.ts index 5fee2b93a0..57a46ab38a 100644 --- a/packages/backend/test/e2e/block.ts +++ b/packages/backend/test/e2e/block.ts @@ -5,7 +5,7 @@ import { signup, api, post, startServer } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('Block', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; // alice blocks bob let alice: any; @@ -13,14 +13,14 @@ describe('Block', () => { let carol: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); test('Block作成', async () => { diff --git a/packages/backend/test/e2e/endpoints.ts b/packages/backend/test/e2e/endpoints.ts index 653520cf5f..cbe7b894f4 100644 --- a/packages/backend/test/e2e/endpoints.ts +++ b/packages/backend/test/e2e/endpoints.ts @@ -8,7 +8,7 @@ import { startServer, signup, post, api, uploadFile, simpleGet } from '../utils. import type { INestApplicationContext } from '@nestjs/common'; describe('Endpoints', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let alice: any; let bob: any; @@ -16,7 +16,7 @@ describe('Endpoints', () => { let dave: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); @@ -24,7 +24,7 @@ describe('Endpoints', () => { }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); describe('signup', () => { diff --git a/packages/backend/test/e2e/fetch-resource.ts b/packages/backend/test/e2e/fetch-resource.ts index 38cf1c2985..9643c45d1a 100644 --- a/packages/backend/test/e2e/fetch-resource.ts +++ b/packages/backend/test/e2e/fetch-resource.ts @@ -16,13 +16,13 @@ const HTML = 'text/html; charset=utf-8'; const JSON_UTF8 = 'application/json; charset=utf-8'; describe('Fetch resource', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let alice: any; let alicesPost: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); alicesPost = await post(alice, { text: 'test', @@ -30,7 +30,7 @@ describe('Fetch resource', () => { }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); describe('Common', () => { diff --git a/packages/backend/test/e2e/ff-visibility.ts b/packages/backend/test/e2e/ff-visibility.ts index d53919ca1e..7b75005a39 100644 --- a/packages/backend/test/e2e/ff-visibility.ts +++ b/packages/backend/test/e2e/ff-visibility.ts @@ -5,19 +5,19 @@ import { signup, api, startServer, simpleGet } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('FF visibility', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let alice: any; let bob: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); test('ffVisibility が public なユーザーのフォロー/フォロワーを誰でも見れる', async () => { diff --git a/packages/backend/test/e2e/mute.ts b/packages/backend/test/e2e/mute.ts index 5811d6baf4..25bd532cfb 100644 --- a/packages/backend/test/e2e/mute.ts +++ b/packages/backend/test/e2e/mute.ts @@ -5,7 +5,7 @@ import { signup, api, post, react, startServer, waitFire } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('Mute', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; // alice mutes carol let alice: any; @@ -13,14 +13,14 @@ describe('Mute', () => { let carol: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); test('ミュート作成', async () => { diff --git a/packages/backend/test/e2e/note.ts b/packages/backend/test/e2e/note.ts index f286152e8e..e87045a8cf 100644 --- a/packages/backend/test/e2e/note.ts +++ b/packages/backend/test/e2e/note.ts @@ -6,14 +6,14 @@ import { signup, post, uploadUrl, startServer, initTestDb, api, uploadFile } fro import type { INestApplicationContext } from '@nestjs/common'; describe('Note', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let Notes: any; let alice: any; let bob: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); const connection = await initTestDb(true); Notes = connection.getRepository(Note); alice = await signup({ username: 'alice' }); @@ -21,7 +21,7 @@ describe('Note', () => { }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); test('投稿できる', async () => { diff --git a/packages/backend/test/e2e/renote-mute.ts b/packages/backend/test/e2e/renote-mute.ts index 32c8ebe2c5..0f73b8d09f 100644 --- a/packages/backend/test/e2e/renote-mute.ts +++ b/packages/backend/test/e2e/renote-mute.ts @@ -5,7 +5,7 @@ import { signup, api, post, react, startServer, waitFire } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('Renote Mute', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; // alice mutes carol let alice: any; @@ -13,14 +13,14 @@ describe('Renote Mute', () => { let carol: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); test('ミュート作成', async () => { diff --git a/packages/backend/test/e2e/streaming.ts b/packages/backend/test/e2e/streaming.ts index 23c431f2e7..e1b690c30f 100644 --- a/packages/backend/test/e2e/streaming.ts +++ b/packages/backend/test/e2e/streaming.ts @@ -6,7 +6,7 @@ import { connectStream, signup, api, post, startServer, initTestDb, waitFire } f import type { INestApplicationContext } from '@nestjs/common'; describe('Streaming', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let Followings: any; const follow = async (follower: any, followee: any) => { @@ -38,7 +38,7 @@ describe('Streaming', () => { let list: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); const connection = await initTestDb(true); Followings = connection.getRepository(Following); @@ -74,7 +74,7 @@ describe('Streaming', () => { }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); describe('Events', () => { diff --git a/packages/backend/test/e2e/thread-mute.ts b/packages/backend/test/e2e/thread-mute.ts index 792436d88f..2ae2eb67c1 100644 --- a/packages/backend/test/e2e/thread-mute.ts +++ b/packages/backend/test/e2e/thread-mute.ts @@ -5,21 +5,21 @@ import { signup, api, post, connectStream, startServer } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('Note thread mute', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let alice: any; let bob: any; let carol: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); afterAll(async () => { - await p.close(); + await app.close(); }); test('notes/mentions にミュートしているスレッドの投稿が含まれない', async () => { diff --git a/packages/backend/test/e2e/user-notes.ts b/packages/backend/test/e2e/user-notes.ts index 690cba1746..c11099e7b5 100644 --- a/packages/backend/test/e2e/user-notes.ts +++ b/packages/backend/test/e2e/user-notes.ts @@ -5,7 +5,7 @@ import { signup, api, post, uploadUrl, startServer } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; describe('users/notes', () => { - let p: INestApplicationContext; + let app: INestApplicationContext; let alice: any; let jpgNote: any; @@ -13,7 +13,7 @@ describe('users/notes', () => { let jpgPngNote: any; beforeAll(async () => { - p = await startServer(); + app = await startServer(); alice = await signup({ username: 'alice' }); const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.png'); @@ -29,7 +29,7 @@ describe('users/notes', () => { }, 1000 * 60 * 2); afterAll(async() => { - await p.close(); + await app.close(); }); test('ファイルタイプ指定 (jpg)', async () => {