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

@ -6,9 +6,8 @@
process.env.NODE_ENV = 'test';
import * as assert from 'assert';
import { startServer, channel, clip, cookie, galleryPost, signup, page, play, post, simpleGet, uploadFile } from '../utils.js';
import { channel, clip, cookie, galleryPost, page, play, post, signup, simpleGet, uploadFile } from '../utils.js';
import type { SimpleGetResponse } from '../utils.js';
import type { INestApplicationContext } from '@nestjs/common';
import type * as misskey from 'misskey-js';
// Request Accept
@ -23,8 +22,6 @@ const HTML = 'text/html; charset=utf-8';
const JSON_UTF8 = 'application/json; charset=utf-8';
describe('Webリソース', () => {
let app: INestApplicationContext;
let alice: misskey.entities.SignupResponse;
let aliceUploadedFile: any;
let alicesPost: any;
@ -79,7 +76,6 @@ describe('Webリソース', () => {
};
beforeAll(async () => {
app = await startServer();
alice = await signup({ username: 'alice' });
aliceUploadedFile = await uploadFile(alice);
alicesPost = await post(alice, {
@ -96,10 +92,6 @@ describe('Webリソース', () => {
bob = await signup({ username: 'bob' });
}, 1000 * 60 * 2);
afterAll(async () => {
await app.close();
});
describe.each([
{ path: '/', type: HTML },
{ path: '/docs/ja-JP/about', type: HTML }, // "指定されたURLに該当するページはありませんでした。"