enhance(backend): テストの高速化 (#12939)

* enhance(backend): テストの高速化

* add ls

* 自動的にマージされるようなので不要

* 起動方法を揃える

* fix test
This commit is contained in:
おさむのひと 2024-01-08 17:43:52 +09:00 committed by GitHub
parent 618e2ba1d2
commit 35ec41fc1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 563 additions and 283 deletions

View file

@ -10,7 +10,7 @@ import * as crypto from 'node:crypto';
import cbor from 'cbor';
import * as OTPAuth from 'otpauth';
import { loadConfig } from '@/config.js';
import { api, signup, startServer } from '../utils.js';
import { api, signup } from '../utils.js';
import type {
AuthenticationResponseJSON,
AuthenticatorAssertionResponseJSON,
@ -19,11 +19,9 @@ import type {
PublicKeyCredentialRequestOptionsJSON,
RegistrationResponseJSON,
} from '@simplewebauthn/typescript-types';
import type { INestApplicationContext } from '@nestjs/common';
import type * as misskey from 'misskey-js';
describe('2要素認証', () => {
let app: INestApplicationContext;
let alice: misskey.entities.SignupResponse;
const config = loadConfig();
@ -185,14 +183,9 @@ describe('2要素認証', () => {
};
beforeAll(async () => {
app = await startServer();
alice = await signup({ username, password });
}, 1000 * 60 * 2);
afterAll(async () => {
await app.close();
});
test('が設定でき、OTPでログインできる。', async () => {
const registerResponse = await api('/i/2fa/register', {
password,