1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-23 22:56:49 +09:00

refactor(test): rename variable for INestApplicationContext

This commit is contained in:
syuilo 2023-03-12 20:57:01 +09:00
parent ba98abc97b
commit a43398ce1d
13 changed files with 39 additions and 39 deletions

View File

@ -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 () => {

View File

@ -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', () => {

View File

@ -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', () => {

View File

@ -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 () => {

View File

@ -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', () => {

View File

@ -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', () => {

View File

@ -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 () => {

View File

@ -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 () => {

View File

@ -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 () => {

View File

@ -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 () => {

View File

@ -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', () => {

View File

@ -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 () => {

View File

@ -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 () => {