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,20 +6,16 @@
process.env.NODE_ENV = 'test';
import * as assert from 'assert';
import { signup, api, post, uploadUrl, startServer } from '../utils.js';
import type { INestApplicationContext } from '@nestjs/common';
import { api, post, signup, uploadUrl } from '../utils.js';
import type * as misskey from 'misskey-js';
describe('users/notes', () => {
let app: INestApplicationContext;
let alice: misskey.entities.SignupResponse;
let jpgNote: any;
let pngNote: any;
let jpgPngNote: any;
beforeAll(async () => {
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');
@ -34,10 +30,6 @@ describe('users/notes', () => {
});
}, 1000 * 60 * 2);
afterAll(async() => {
await app.close();
});
test('withFiles', async () => {
const res = await api('/users/notes', {
userId: alice.id,