From ed3e035ad60d806a7e5b1546d514260f46b6d6cf Mon Sep 17 00:00:00 2001 From: syuilo <Syuilotan@yahoo.co.jp> Date: Thu, 2 Feb 2023 18:18:25 +0900 Subject: [PATCH] refactor: use test --- packages/backend/test/_e2e/api-visibility.ts | 134 ++++++++--------- packages/backend/test/_e2e/api.ts | 14 +- packages/backend/test/_e2e/block.ts | 12 +- packages/backend/test/_e2e/endpoints.ts | 142 +++++++++--------- packages/backend/test/_e2e/fetch-resource.ts | 50 +++--- packages/backend/test/_e2e/ff-visibility.ts | 14 +- packages/backend/test/_e2e/mute.ts | 16 +- packages/backend/test/_e2e/note.ts | 50 +++--- packages/backend/test/_e2e/streaming.ts | 66 ++++---- packages/backend/test/_e2e/thread-mute.ts | 8 +- packages/backend/test/_e2e/user-notes.ts | 4 +- packages/backend/test/prelude/maybe.ts | 6 +- packages/backend/test/prelude/url.ts | 2 +- packages/backend/test/tests/activitypub.ts | 6 +- packages/backend/test/tests/ap-request.ts | 4 +- .../backend/test/tests/extract-mentions.ts | 4 +- packages/backend/test/tests/mfm.ts | 38 ++--- packages/backend/test/tests/reaction-lib.ts | 38 ++--- packages/backend/test/unit/FileInfoService.ts | 18 +-- packages/backend/test/unit/MetaService.ts | 4 +- packages/backend/test/unit/RelayService.ts | 8 +- packages/backend/test/unit/RoleService.ts | 10 +- packages/backend/test/unit/chart.ts | 36 ++--- 23 files changed, 342 insertions(+), 342 deletions(-) diff --git a/packages/backend/test/_e2e/api-visibility.ts b/packages/backend/test/_e2e/api-visibility.ts index 9c21840844..d29b9acb3d 100644 --- a/packages/backend/test/_e2e/api-visibility.ts +++ b/packages/backend/test/_e2e/api-visibility.ts @@ -100,90 +100,90 @@ describe('API visibility', () => { //#region show post // public - it('[show] public-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pub.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] public-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pub.id, follower); assert.strictEqual(res.body.text, 'x'); }); - it('[show] public-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pub.id, other); assert.strictEqual(res.body.text, 'x'); }); - it('[show] public-postを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-postを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pub.id, null); assert.strictEqual(res.body.text, 'x'); }); // home - it('[show] home-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(home.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] home-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(home.id, follower); assert.strictEqual(res.body.text, 'x'); }); - it('[show] home-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(home.id, other); assert.strictEqual(res.body.text, 'x'); }); - it('[show] home-postを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-postを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(home.id, null); assert.strictEqual(res.body.text, 'x'); }); // followers - it('[show] followers-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] followers-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(fol.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] followers-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] followers-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(fol.id, follower); assert.strictEqual(res.body.text, 'x'); }); - it('[show] followers-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] followers-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(fol.id, other); assert.strictEqual(res.body.isHidden, true); }); - it('[show] followers-postを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] followers-postを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(fol.id, null); assert.strictEqual(res.body.isHidden, true); }); // specified - it('[show] specified-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] specified-postを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(spe.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] specified-postを指定ユーザーãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] specified-postを指定ユーザーãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(spe.id, target); assert.strictEqual(res.body.text, 'x'); }); - it('[show] specified-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-postをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(spe.id, follower); assert.strictEqual(res.body.isHidden, true); }); - it('[show] specified-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-postã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(spe.id, other); assert.strictEqual(res.body.isHidden, true); }); - it('[show] specified-postを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-postを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(spe.id, null); assert.strictEqual(res.body.isHidden, true); }); @@ -191,110 +191,110 @@ describe('API visibility', () => { //#region show reply // public - it('[show] public-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubR.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] public-replyã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-replyã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubR.id, target); assert.strictEqual(res.body.text, 'x'); }); - it('[show] public-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubR.id, follower); assert.strictEqual(res.body.text, 'x'); }); - it('[show] public-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubR.id, other); assert.strictEqual(res.body.text, 'x'); }); - it('[show] public-replyを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-replyを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubR.id, null); assert.strictEqual(res.body.text, 'x'); }); // home - it('[show] home-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeR.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] home-replyã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-replyã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeR.id, target); assert.strictEqual(res.body.text, 'x'); }); - it('[show] home-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeR.id, follower); assert.strictEqual(res.body.text, 'x'); }); - it('[show] home-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeR.id, other); assert.strictEqual(res.body.text, 'x'); }); - it('[show] home-replyを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-replyを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeR.id, null); assert.strictEqual(res.body.text, 'x'); }); // followers - it('[show] followers-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] followers-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(folR.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] followers-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ã§ã‚‚リプライã•ã‚Œã¦ã„ã‚Œã°è¦‹ã‚Œã‚‹', async () => { + test('[show] followers-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ã§ã‚‚リプライã•ã‚Œã¦ã„ã‚Œã°è¦‹ã‚Œã‚‹', async () => { const res = await show(folR.id, target); assert.strictEqual(res.body.text, 'x'); }); - it('[show] followers-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] followers-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(folR.id, follower); assert.strictEqual(res.body.text, 'x'); }); - it('[show] followers-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] followers-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(folR.id, other); assert.strictEqual(res.body.isHidden, true); }); - it('[show] followers-replyを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] followers-replyを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(folR.id, null); assert.strictEqual(res.body.isHidden, true); }); // specified - it('[show] specified-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] specified-replyを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(speR.id, alice); assert.strictEqual(res.body.text, 'x'); }); - it('[show] specified-replyを指定ユーザーãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] specified-replyを指定ユーザーãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(speR.id, target); assert.strictEqual(res.body.text, 'x'); }); - it('[show] specified-replyã‚’ã•ã‚ŒãŸäººãŒæŒ‡å®šã•ã‚Œã¦ãªãã¦ã‚‚見れる', async () => { + test('[show] specified-replyã‚’ã•ã‚ŒãŸäººãŒæŒ‡å®šã•ã‚Œã¦ãªãã¦ã‚‚見れる', async () => { const res = await show(speR.id, target); assert.strictEqual(res.body.text, 'x'); }); - it('[show] specified-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-replyをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(speR.id, follower); assert.strictEqual(res.body.isHidden, true); }); - it('[show] specified-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-replyã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(speR.id, other); assert.strictEqual(res.body.isHidden, true); }); - it('[show] specified-replyを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-replyを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(speR.id, null); assert.strictEqual(res.body.isHidden, true); }); @@ -302,131 +302,131 @@ describe('API visibility', () => { //#region show mention // public - it('[show] public-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubM.id, alice); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] public-mentionã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-mentionã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubM.id, target); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] public-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubM.id, follower); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] public-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubM.id, other); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] public-mentionを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] public-mentionを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(pubM.id, null); assert.strictEqual(res.body.text, '@target x'); }); // home - it('[show] home-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeM.id, alice); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] home-mentionã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-mentionã‚’ã•ã‚ŒãŸäººãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeM.id, target); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] home-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeM.id, follower); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] home-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeM.id, other); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] home-mentionを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] home-mentionを未èªè¨¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(homeM.id, null); assert.strictEqual(res.body.text, '@target x'); }); // followers - it('[show] followers-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] followers-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(folM.id, alice); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] followers-mentionをメンションã•ã‚Œã¦ã„ã‚Œã°éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ã§ã‚‚見れる', async () => { + test('[show] followers-mentionをメンションã•ã‚Œã¦ã„ã‚Œã°éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ã§ã‚‚見れる', async () => { const res = await show(folM.id, target); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] followers-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] followers-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(folM.id, follower); assert.strictEqual(res.body.text, '@target x'); }); - it('[show] followers-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] followers-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(folM.id, other); assert.strictEqual(res.body.isHidden, true); }); - it('[show] followers-mentionを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] followers-mentionを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(folM.id, null); assert.strictEqual(res.body.isHidden, true); }); // specified - it('[show] specified-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] specified-mentionを自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(speM.id, alice); assert.strictEqual(res.body.text, '@target2 x'); }); - it('[show] specified-mentionを指定ユーザーãŒè¦‹ã‚Œã‚‹', async () => { + test('[show] specified-mentionを指定ユーザーãŒè¦‹ã‚Œã‚‹', async () => { const res = await show(speM.id, target); assert.strictEqual(res.body.text, '@target2 x'); }); - it('[show] specified-mentionã‚’ã•ã‚ŒãŸäººãŒæŒ‡å®šã•ã‚Œã¦ãªã‹ã£ãŸã‚‰è¦‹ã‚Œãªã„', async () => { + test('[show] specified-mentionã‚’ã•ã‚ŒãŸäººãŒæŒ‡å®šã•ã‚Œã¦ãªã‹ã£ãŸã‚‰è¦‹ã‚Œãªã„', async () => { const res = await show(speM.id, target2); assert.strictEqual(res.body.isHidden, true); }); - it('[show] specified-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-mentionをフォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(speM.id, follower); assert.strictEqual(res.body.isHidden, true); }); - it('[show] specified-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-mentionã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(speM.id, other); assert.strictEqual(res.body.isHidden, true); }); - it('[show] specified-mentionを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { + test('[show] specified-mentionを未èªè¨¼ãŒè¦‹ã‚Œãªã„', async () => { const res = await show(speM.id, null); assert.strictEqual(res.body.isHidden, true); }); //#endregion //#region HTL - it('[HTL] public-post ㌠自分ãŒè¦‹ã‚Œã‚‹', async () => { + test('[HTL] public-post ㌠自分ãŒè¦‹ã‚Œã‚‹', async () => { const res = await request('/notes/timeline', { limit: 100 }, alice); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === pub.id); assert.strictEqual(notes[0].text, 'x'); }); - it('[HTL] public-post ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ã‹ã‚‰è¦‹ã‚Œãªã„', async () => { + test('[HTL] public-post ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ã‹ã‚‰è¦‹ã‚Œãªã„', async () => { const res = await request('/notes/timeline', { limit: 100 }, other); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === pub.id); assert.strictEqual(notes.length, 0); }); - it('[HTL] followers-post ㌠フォãƒãƒ¯ãƒ¼ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { + test('[HTL] followers-post ㌠フォãƒãƒ¯ãƒ¼ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { const res = await request('/notes/timeline', { limit: 100 }, follower); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === fol.id); @@ -435,21 +435,21 @@ describe('API visibility', () => { //#endregion //#region RTL - it('[replies] followers-reply ㌠フォãƒãƒ¯ãƒ¼ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { + test('[replies] followers-reply ㌠フォãƒãƒ¯ãƒ¼ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, follower); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === folR.id); assert.strictEqual(notes[0].text, 'x'); }); - it('[replies] followers-reply ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (リプライ先ã§ã¯ãªã„) ã‹ã‚‰è¦‹ã‚Œãªã„', async () => { + test('[replies] followers-reply ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (リプライ先ã§ã¯ãªã„) ã‹ã‚‰è¦‹ã‚Œãªã„', async () => { const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, other); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === folR.id); assert.strictEqual(notes.length, 0); }); - it('[replies] followers-reply ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (リプライ先ã§ã‚ã‚‹) ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { + test('[replies] followers-reply ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (リプライ先ã§ã‚ã‚‹) ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, target); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === folR.id); @@ -458,14 +458,14 @@ describe('API visibility', () => { //#endregion //#region MTL - it('[mentions] followers-reply ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (リプライ先ã§ã‚ã‚‹) ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { + test('[mentions] followers-reply ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (リプライ先ã§ã‚ã‚‹) ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { const res = await request('/notes/mentions', { limit: 100 }, target); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === folR.id); assert.strictEqual(notes[0].text, 'x'); }); - it('[mentions] followers-mention ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (メンション先ã§ã‚ã‚‹) ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { + test('[mentions] followers-mention ㌠éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ (メンション先ã§ã‚ã‚‹) ã‹ã‚‰è¦‹ã‚Œã‚‹', async () => { const res = await request('/notes/mentions', { limit: 100 }, target); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id === folM.id); diff --git a/packages/backend/test/_e2e/api.ts b/packages/backend/test/_e2e/api.ts index 3c08022031..7542c34db0 100644 --- a/packages/backend/test/_e2e/api.ts +++ b/packages/backend/test/_e2e/api.ts @@ -22,7 +22,7 @@ describe('API', () => { }); describe('General validation', () => { - it('wrong type', async(async () => { + test('wrong type', async(async () => { const res = await request('/test', { required: true, string: 42, @@ -30,14 +30,14 @@ describe('API', () => { assert.strictEqual(res.status, 400); })); - it('missing require param', async(async () => { + test('missing require param', async(async () => { const res = await request('/test', { string: 'a', }); assert.strictEqual(res.status, 400); })); - it('invalid misskey:id (empty string)', async(async () => { + test('invalid misskey:id (empty string)', async(async () => { const res = await request('/test', { required: true, id: '', @@ -45,7 +45,7 @@ describe('API', () => { assert.strictEqual(res.status, 400); })); - it('valid misskey:id', async(async () => { + test('valid misskey:id', async(async () => { const res = await request('/test', { required: true, id: '8wvhjghbxu', @@ -53,7 +53,7 @@ describe('API', () => { assert.strictEqual(res.status, 200); })); - it('default value', async(async () => { + test('default value', async(async () => { const res = await request('/test', { required: true, string: 'a', @@ -62,7 +62,7 @@ describe('API', () => { assert.strictEqual(res.body.default, 'hello'); })); - it('can set null even if it has default value', async(async () => { + test('can set null even if it has default value', async(async () => { const res = await request('/test', { required: true, nullableDefault: null, @@ -71,7 +71,7 @@ describe('API', () => { assert.strictEqual(res.body.nullableDefault, null); })); - it('cannot set undefined if it has default value', async(async () => { + test('cannot set undefined if it has default value', async(async () => { const res = await request('/test', { required: true, nullableDefault: undefined, diff --git a/packages/backend/test/_e2e/block.ts b/packages/backend/test/_e2e/block.ts index bb31983a32..c5f43e153c 100644 --- a/packages/backend/test/_e2e/block.ts +++ b/packages/backend/test/_e2e/block.ts @@ -23,7 +23,7 @@ describe('Block', () => { await shutdownServer(p); }); - it('Block作æˆ', async () => { + test('Block作æˆ', async () => { const res = await request('/blocking/create', { userId: bob.id, }, alice); @@ -31,14 +31,14 @@ describe('Block', () => { assert.strictEqual(res.status, 200); }); - it('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーをフォãƒãƒ¼ã§ããªã„', async () => { + test('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーをフォãƒãƒ¼ã§ããªã„', async () => { const res = await request('/following/create', { userId: alice.id }, bob); assert.strictEqual(res.status, 400); assert.strictEqual(res.body.error.id, 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0'); }); - it('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã«ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã§ããªã„', async () => { + test('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã«ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã§ããªã„', async () => { const note = await post(alice, { text: 'hello' }); const res = await request('/notes/reactions/create', { noteId: note.id, reaction: 'ðŸ‘' }, bob); @@ -47,7 +47,7 @@ describe('Block', () => { assert.strictEqual(res.body.error.id, '20ef5475-9f38-4e4c-bd33-de6d979498ec'); }); - it('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã«è¿”ä¿¡ã§ããªã„', async () => { + test('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã«è¿”ä¿¡ã§ããªã„', async () => { const note = await post(alice, { text: 'hello' }); const res = await request('/notes/create', { replyId: note.id, text: 'yo' }, bob); @@ -56,7 +56,7 @@ describe('Block', () => { assert.strictEqual(res.body.error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3'); }); - it('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã®ãƒŽãƒ¼ãƒˆã‚’Renoteã§ããªã„', async () => { + test('ブãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã®ãƒŽãƒ¼ãƒˆã‚’Renoteã§ããªã„', async () => { const note = await post(alice, { text: 'hello' }); const res = await request('/notes/create', { renoteId: note.id, text: 'yo' }, bob); @@ -69,7 +69,7 @@ describe('Block', () => { // TODO: ユーザーリストã‹ã‚‰é™¤å¤–ã•ã‚Œã‚‹ãƒ†ã‚¹ãƒˆ - it('タイムライン(LTL)ã«ãƒ–ãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { + test('タイムライン(LTL)ã«ãƒ–ãƒãƒƒã‚¯ã•ã‚Œã¦ã„るユーザーã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { const aliceNote = await post(alice); const bobNote = await post(bob); const carolNote = await post(carol); diff --git a/packages/backend/test/_e2e/endpoints.ts b/packages/backend/test/_e2e/endpoints.ts index 05b74a65d4..ea8433dfa2 100644 --- a/packages/backend/test/_e2e/endpoints.ts +++ b/packages/backend/test/_e2e/endpoints.ts @@ -22,7 +22,7 @@ describe('Endpoints', () => { }); describe('signup', () => { - it('ä¸æ£ãªãƒ¦ãƒ¼ã‚¶ãƒ¼åã§ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãŒä½œæˆã§ããªã„', async () => { + test('ä¸æ£ãªãƒ¦ãƒ¼ã‚¶ãƒ¼åã§ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãŒä½œæˆã§ããªã„', async () => { const res = await request('api/signup', { username: 'test.', password: 'test', @@ -30,7 +30,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('空ã®ãƒ‘スワードã§ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãŒä½œæˆã§ããªã„', async () => { + test('空ã®ãƒ‘スワードã§ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãŒä½œæˆã§ããªã„', async () => { const res = await request('api/signup', { username: 'test', password: '', @@ -38,7 +38,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('æ£ã—ãアカウントãŒä½œæˆã§ãã‚‹', async () => { + test('æ£ã—ãアカウントãŒä½œæˆã§ãã‚‹', async () => { const me = { username: 'test1', password: 'test1', @@ -51,7 +51,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body.username, me.username); }); - it('åŒã˜ãƒ¦ãƒ¼ã‚¶ãƒ¼åã®ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã¯ä½œæˆã§ããªã„', async () => { + test('åŒã˜ãƒ¦ãƒ¼ã‚¶ãƒ¼åã®ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã¯ä½œæˆã§ããªã„', async () => { const res = await request('api/signup', { username: 'test1', password: 'test1', @@ -62,7 +62,7 @@ describe('Endpoints', () => { }); describe('signin', () => { - it('é–“é•ã£ãŸãƒ‘スワードã§ã‚µã‚¤ãƒ³ã‚¤ãƒ³ã§ããªã„', async () => { + test('é–“é•ã£ãŸãƒ‘スワードã§ã‚µã‚¤ãƒ³ã‚¤ãƒ³ã§ããªã„', async () => { const res = await request('api/signin', { username: 'test1', password: 'bar', @@ -71,7 +71,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 403); }); - it('クエリをインジェクションã§ããªã„', async () => { + test('クエリをインジェクションã§ããªã„', async () => { const res = await request('api/signin', { username: 'test1', password: { @@ -82,7 +82,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('æ£ã—ã„æƒ…å ±ã§ã‚µã‚¤ãƒ³ã‚¤ãƒ³ã§ãã‚‹', async () => { + test('æ£ã—ã„æƒ…å ±ã§ã‚µã‚¤ãƒ³ã‚¤ãƒ³ã§ãã‚‹', async () => { const res = await request('api/signin', { username: 'test1', password: 'test1', @@ -93,7 +93,7 @@ describe('Endpoints', () => { }); describe('i/update', () => { - it('アカウントè¨å®šã‚’æ›´æ–°ã§ãã‚‹', async () => { + test('アカウントè¨å®šã‚’æ›´æ–°ã§ãã‚‹', async () => { const myName = '大室櫻å'; const myLocation = '七森ä¸'; const myBirthday = '2000-09-07'; @@ -111,14 +111,14 @@ describe('Endpoints', () => { assert.strictEqual(res.body.birthday, myBirthday); }); - it('åå‰ã‚’空白ã«ã§ããªã„', async () => { + test('åå‰ã‚’空白ã«ã§ããªã„', async () => { const res = await api('/i/update', { name: ' ', }, alice); assert.strictEqual(res.status, 400); }); - it('誕生日ã®è¨å®šã‚’削除ã§ãã‚‹', async () => { + test('誕生日ã®è¨å®šã‚’削除ã§ãã‚‹', async () => { await api('/i/update', { birthday: '2000-09-07', }, alice); @@ -132,7 +132,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body.birthday, null); }); - it('ä¸æ£ãªèª•ç”Ÿæ—¥ã®å½¢å¼ã§æ€’られる', async () => { + test('ä¸æ£ãªèª•ç”Ÿæ—¥ã®å½¢å¼ã§æ€’られる', async () => { const res = await api('/i/update', { birthday: '2000/09/07', }, alice); @@ -141,7 +141,7 @@ describe('Endpoints', () => { }); describe('users/show', () => { - it('ユーザーãŒå–å¾—ã§ãã‚‹', async () => { + test('ユーザーãŒå–å¾—ã§ãã‚‹', async () => { const res = await api('/users/show', { userId: alice.id, }, alice); @@ -151,14 +151,14 @@ describe('Endpoints', () => { assert.strictEqual(res.body.id, alice.id); }); - it('ユーザーãŒå˜åœ¨ã—ãªã‹ã£ãŸã‚‰æ€’ã‚‹', async () => { + test('ユーザーãŒå˜åœ¨ã—ãªã‹ã£ãŸã‚‰æ€’ã‚‹', async () => { const res = await api('/users/show', { userId: '000000000000000000000000', }); assert.strictEqual(res.status, 400); }); - it('é–“é•ã£ãŸIDã§æ€’られる', async () => { + test('é–“é•ã£ãŸIDã§æ€’られる', async () => { const res = await api('/users/show', { userId: 'kyoppie', }); @@ -167,7 +167,7 @@ describe('Endpoints', () => { }); describe('notes/show', () => { - it('投稿ãŒå–å¾—ã§ãã‚‹', async () => { + test('投稿ãŒå–å¾—ã§ãã‚‹', async () => { const myPost = await post(alice, { text: 'test', }); @@ -182,14 +182,14 @@ describe('Endpoints', () => { assert.strictEqual(res.body.text, myPost.text); }); - it('投稿ãŒå˜åœ¨ã—ãªã‹ã£ãŸã‚‰æ€’ã‚‹', async () => { + test('投稿ãŒå˜åœ¨ã—ãªã‹ã£ãŸã‚‰æ€’ã‚‹', async () => { const res = await api('/notes/show', { noteId: '000000000000000000000000', }); assert.strictEqual(res.status, 400); }); - it('é–“é•ã£ãŸIDã§æ€’られる', async () => { + test('é–“é•ã£ãŸIDã§æ€’られる', async () => { const res = await api('/notes/show', { noteId: 'kyoppie', }); @@ -198,7 +198,7 @@ describe('Endpoints', () => { }); describe('notes/reactions/create', () => { - it('リアクションã§ãã‚‹', async () => { + test('リアクションã§ãã‚‹', async () => { const bobPost = await post(bob); const alice = await signup({ username: 'alice' }); @@ -217,7 +217,7 @@ describe('Endpoints', () => { assert.strictEqual(resNote.body.reactions['🚀'], [alice.id]); }); - it('自分ã®æŠ•ç¨¿ã«ã‚‚リアクションã§ãã‚‹', async () => { + test('自分ã®æŠ•ç¨¿ã«ã‚‚リアクションã§ãã‚‹', async () => { const myPost = await post(alice); const res = await api('/notes/reactions/create', { @@ -228,7 +228,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 204); }); - it('二é‡ã«ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã§ããªã„', async () => { + test('二é‡ã«ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã§ããªã„', async () => { const bobPost = await post(bob); await api('/notes/reactions/create', { @@ -244,7 +244,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('å˜åœ¨ã—ãªã„投稿ã«ã¯ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã§ããªã„', async () => { + test('å˜åœ¨ã—ãªã„投稿ã«ã¯ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã§ããªã„', async () => { const res = await api('/notes/reactions/create', { noteId: '000000000000000000000000', reaction: '🚀', @@ -253,13 +253,13 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('空ã®ãƒ‘ラメータã§æ€’られる', async () => { + test('空ã®ãƒ‘ラメータã§æ€’られる', async () => { const res = await api('/notes/reactions/create', {}, alice); assert.strictEqual(res.status, 400); }); - it('é–“é•ã£ãŸIDã§æ€’られる', async () => { + test('é–“é•ã£ãŸIDã§æ€’られる', async () => { const res = await api('/notes/reactions/create', { noteId: 'kyoppie', reaction: '🚀', @@ -270,7 +270,7 @@ describe('Endpoints', () => { }); describe('following/create', () => { - it('フォãƒãƒ¼ã§ãã‚‹', async () => { + test('フォãƒãƒ¼ã§ãã‚‹', async () => { const res = await api('/following/create', { userId: alice.id, }, bob); @@ -278,7 +278,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 200); }); - it('æ—¢ã«ãƒ•ã‚©ãƒãƒ¼ã—ã¦ã„ã‚‹å ´åˆã¯æ€’ã‚‹', async () => { + test('æ—¢ã«ãƒ•ã‚©ãƒãƒ¼ã—ã¦ã„ã‚‹å ´åˆã¯æ€’ã‚‹', async () => { const res = await api('/following/create', { userId: alice.id, }, bob); @@ -286,7 +286,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('å˜åœ¨ã—ãªã„ユーザーã¯ãƒ•ã‚©ãƒãƒ¼ã§ããªã„', async () => { + test('å˜åœ¨ã—ãªã„ユーザーã¯ãƒ•ã‚©ãƒãƒ¼ã§ããªã„', async () => { const res = await api('/following/create', { userId: '000000000000000000000000', }, alice); @@ -294,7 +294,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('自分自身ã¯ãƒ•ã‚©ãƒãƒ¼ã§ããªã„', async () => { + test('自分自身ã¯ãƒ•ã‚©ãƒãƒ¼ã§ããªã„', async () => { const res = await api('/following/create', { userId: alice.id, }, alice); @@ -302,13 +302,13 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('空ã®ãƒ‘ラメータã§æ€’られる', async () => { + test('空ã®ãƒ‘ラメータã§æ€’られる', async () => { const res = await api('/following/create', {}, alice); assert.strictEqual(res.status, 400); }); - it('é–“é•ã£ãŸIDã§æ€’られる', async () => { + test('é–“é•ã£ãŸIDã§æ€’られる', async () => { const res = await api('/following/create', { userId: 'foo', }, alice); @@ -318,7 +318,7 @@ describe('Endpoints', () => { }); describe('following/delete', () => { - it('フォãƒãƒ¼è§£é™¤ã§ãã‚‹', async () => { + test('フォãƒãƒ¼è§£é™¤ã§ãã‚‹', async () => { await api('/following/create', { userId: alice.id, }, bob); @@ -330,7 +330,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 200); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„å ´åˆã¯æ€’ã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„å ´åˆã¯æ€’ã‚‹', async () => { const res = await api('/following/delete', { userId: alice.id, }, bob); @@ -338,7 +338,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('å˜åœ¨ã—ãªã„ユーザーã¯ãƒ•ã‚©ãƒãƒ¼è§£é™¤ã§ããªã„', async () => { + test('å˜åœ¨ã—ãªã„ユーザーã¯ãƒ•ã‚©ãƒãƒ¼è§£é™¤ã§ããªã„', async () => { const res = await api('/following/delete', { userId: '000000000000000000000000', }, alice); @@ -346,7 +346,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('自分自身ã¯ãƒ•ã‚©ãƒãƒ¼è§£é™¤ã§ããªã„', async () => { + test('自分自身ã¯ãƒ•ã‚©ãƒãƒ¼è§£é™¤ã§ããªã„', async () => { const res = await api('/following/delete', { userId: alice.id, }, alice); @@ -354,13 +354,13 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - it('空ã®ãƒ‘ラメータã§æ€’られる', async () => { + test('空ã®ãƒ‘ラメータã§æ€’られる', async () => { const res = await api('/following/delete', {}, alice); assert.strictEqual(res.status, 400); }); - it('é–“é•ã£ãŸIDã§æ€’られる', async () => { + test('é–“é•ã£ãŸIDã§æ€’られる', async () => { const res = await api('/following/delete', { userId: 'kyoppie', }, alice); @@ -371,7 +371,7 @@ describe('Endpoints', () => { /* describe('/i', () => { - it('', async () => { + test('', async () => { }); }); */ @@ -402,7 +402,7 @@ describe('API: Endpoints', () => { }); describe('drive', () => { - it('ãƒ‰ãƒ©ã‚¤ãƒ–æƒ…å ±ã‚’å–å¾—ã§ãã‚‹', async () => { + test('ãƒ‰ãƒ©ã‚¤ãƒ–æƒ…å ±ã‚’å–å¾—ã§ãã‚‹', async () => { await uploadFile({ userId: alice.id, size: 256 @@ -423,7 +423,7 @@ describe('API: Endpoints', () => { }); describe('drive/files/create', () => { - it('ファイルを作æˆã§ãã‚‹', async () => { + test('ファイルを作æˆã§ãã‚‹', async () => { const res = await uploadFile(alice); assert.strictEqual(res.status, 200); @@ -431,7 +431,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.name, 'Lenna.png'); })); - it('ファイルã«åå‰ã‚’付ã‘られる', async () => { + test('ファイルã«åå‰ã‚’付ã‘られる', async () => { const res = await assert.request(server) .post('/drive/files/create') .field('i', alice.token) @@ -443,13 +443,13 @@ describe('API: Endpoints', () => { expect(res.body).have.property('name').eql('Belmond.png'); })); - it('ファイル無ã—ã§æ€’られる', async () => { + test('ファイル無ã—ã§æ€’られる', async () => { const res = await api('/drive/files/create', {}, alice); assert.strictEqual(res.status, 400); })); - it('SVGファイルを作æˆã§ãã‚‹', async () => { + test('SVGファイルを作æˆã§ãã‚‹', async () => { const res = await uploadFile(alice, __dirname + '/resources/image.svg'); assert.strictEqual(res.status, 200); @@ -460,7 +460,7 @@ describe('API: Endpoints', () => { }); describe('drive/files/update', () => { - it('åå‰ã‚’æ›´æ–°ã§ãã‚‹', async () => { + test('åå‰ã‚’æ›´æ–°ã§ãã‚‹', async () => { const file = await uploadFile(alice); const newName = 'ã„ã¡ã”パスタ.png'; @@ -474,7 +474,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.name, newName); })); - it('他人ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¯æ›´æ–°ã§ããªã„', async () => { + test('他人ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¯æ›´æ–°ã§ããªã„', async () => { const file = await uploadFile(bob); const res = await api('/drive/files/update', { @@ -485,7 +485,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('親フォルダを更新ã§ãã‚‹', async () => { + test('親フォルダを更新ã§ãã‚‹', async () => { const file = await uploadFile(alice); const folder = (await api('/drive/folders/create', { name: 'test' @@ -501,7 +501,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.folderId, folder.id); })); - it('親フォルダを無ã—ã«ã§ãã‚‹', async () => { + test('親フォルダを無ã—ã«ã§ãã‚‹', async () => { const file = await uploadFile(alice); const folder = (await api('/drive/folders/create', { @@ -523,7 +523,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.folderId, null); })); - it('他人ã®ãƒ•ã‚©ãƒ«ãƒ€ã«ã¯å…¥ã‚Œã‚‰ã‚Œãªã„', async () => { + test('他人ã®ãƒ•ã‚©ãƒ«ãƒ€ã«ã¯å…¥ã‚Œã‚‰ã‚Œãªã„', async () => { const file = await uploadFile(alice); const folder = (await api('/drive/folders/create', { name: 'test' @@ -537,7 +537,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('å˜åœ¨ã—ãªã„フォルダã§æ€’られる', async () => { + test('å˜åœ¨ã—ãªã„フォルダã§æ€’られる', async () => { const file = await uploadFile(alice); const res = await api('/drive/files/update', { @@ -548,7 +548,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('ä¸æ£ãªãƒ•ã‚©ãƒ«ãƒ€IDã§æ€’られる', async () => { + test('ä¸æ£ãªãƒ•ã‚©ãƒ«ãƒ€IDã§æ€’られる', async () => { const file = await uploadFile(alice); const res = await api('/drive/files/update', { @@ -559,7 +559,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('ファイルãŒå˜åœ¨ã—ãªã‹ã£ãŸã‚‰æ€’ã‚‹', async () => { + test('ファイルãŒå˜åœ¨ã—ãªã‹ã£ãŸã‚‰æ€’ã‚‹', async () => { const res = await api('/drive/files/update', { fileId: '000000000000000000000000', name: 'ã„ã¡ã”パスタ.png' @@ -568,7 +568,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('é–“é•ã£ãŸIDã§æ€’られる', async () => { + test('é–“é•ã£ãŸIDã§æ€’られる', async () => { const res = await api('/drive/files/update', { fileId: 'kyoppie', name: 'ã„ã¡ã”パスタ.png' @@ -579,7 +579,7 @@ describe('API: Endpoints', () => { }); describe('drive/folders/create', () => { - it('フォルダを作æˆã§ãã‚‹', async () => { + test('フォルダを作æˆã§ãã‚‹', async () => { const res = await api('/drive/folders/create', { name: 'test' }, alice); @@ -591,7 +591,7 @@ describe('API: Endpoints', () => { }); describe('drive/folders/update', () => { - it('åå‰ã‚’æ›´æ–°ã§ãã‚‹', async () => { + test('åå‰ã‚’æ›´æ–°ã§ãã‚‹', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -606,7 +606,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.name, 'new name'); })); - it('他人ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’æ›´æ–°ã§ããªã„', async () => { + test('他人ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’æ›´æ–°ã§ããªã„', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, bob)).body; @@ -619,7 +619,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('親フォルダを更新ã§ãã‚‹', async () => { + test('親フォルダを更新ã§ãã‚‹', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -637,7 +637,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.parentId, parentFolder.id); })); - it('親フォルダを無ã—ã«æ›´æ–°ã§ãã‚‹', async () => { + test('親フォルダを無ã—ã«æ›´æ–°ã§ãã‚‹', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -659,7 +659,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.parentId, null); })); - it('他人ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’親フォルダã«è¨å®šã§ããªã„', async () => { + test('他人ã®ãƒ•ã‚©ãƒ«ãƒ€ã‚’親フォルダã«è¨å®šã§ããªã„', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -675,7 +675,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('フォルダãŒå¾ªç’°ã™ã‚‹ã‚ˆã†ãªæ§‹é€ ã«ã§ããªã„', async () => { + test('フォルダãŒå¾ªç’°ã™ã‚‹ã‚ˆã†ãªæ§‹é€ ã«ã§ããªã„', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -695,7 +695,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('フォルダãŒå¾ªç’°ã™ã‚‹ã‚ˆã†ãªæ§‹é€ ã«ã§ããªã„(å†å¸°çš„)', async () => { + test('フォルダãŒå¾ªç’°ã™ã‚‹ã‚ˆã†ãªæ§‹é€ ã«ã§ããªã„(å†å¸°çš„)', async () => { const folderA = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -722,7 +722,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('フォルダãŒå¾ªç’°ã™ã‚‹ã‚ˆã†ãªæ§‹é€ ã«ã§ããªã„(自身)', async () => { + test('フォルダãŒå¾ªç’°ã™ã‚‹ã‚ˆã†ãªæ§‹é€ ã«ã§ããªã„(自身)', async () => { const folderA = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -735,7 +735,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('å˜åœ¨ã—ãªã„親フォルダをè¨å®šã§ããªã„', async () => { + test('å˜åœ¨ã—ãªã„親フォルダをè¨å®šã§ããªã„', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -748,7 +748,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('ä¸æ£ãªè¦ªãƒ•ã‚©ãƒ«ãƒ€IDã§æ€’られる', async () => { + test('ä¸æ£ãªè¦ªãƒ•ã‚©ãƒ«ãƒ€IDã§æ€’られる', async () => { const folder = (await api('/drive/folders/create', { name: 'test' }, alice)).body; @@ -761,7 +761,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('å˜åœ¨ã—ãªã„フォルダを更新ã§ããªã„', async () => { + test('å˜åœ¨ã—ãªã„フォルダを更新ã§ããªã„', async () => { const res = await api('/drive/folders/update', { folderId: '000000000000000000000000' }, alice); @@ -769,7 +769,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('ä¸æ£ãªãƒ•ã‚©ãƒ«ãƒ€IDã§æ€’られる', async () => { + test('ä¸æ£ãªãƒ•ã‚©ãƒ«ãƒ€IDã§æ€’られる', async () => { const res = await api('/drive/folders/update', { folderId: 'foo' }, alice); @@ -779,7 +779,7 @@ describe('API: Endpoints', () => { }); describe('messaging/messages/create', () => { - it('メッセージをé€ä¿¡ã§ãã‚‹', async () => { + test('メッセージをé€ä¿¡ã§ãã‚‹', async () => { const res = await api('/messaging/messages/create', { userId: bob.id, text: 'test' @@ -790,7 +790,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.body.text, 'test'); })); - it('自分自身ã«ã¯ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’é€ä¿¡ã§ããªã„', async () => { + test('自分自身ã«ã¯ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’é€ä¿¡ã§ããªã„', async () => { const res = await api('/messaging/messages/create', { userId: alice.id, text: 'Yo' @@ -799,7 +799,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('å˜åœ¨ã—ãªã„ユーザーã«ã¯ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’é€ä¿¡ã§ããªã„', async () => { + test('å˜åœ¨ã—ãªã„ユーザーã«ã¯ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’é€ä¿¡ã§ããªã„', async () => { const res = await api('/messaging/messages/create', { userId: '000000000000000000000000', text: 'test' @@ -808,7 +808,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('ä¸æ£ãªãƒ¦ãƒ¼ã‚¶ãƒ¼IDã§æ€’られる', async () => { + test('ä¸æ£ãªãƒ¦ãƒ¼ã‚¶ãƒ¼IDã§æ€’られる', async () => { const res = await api('/messaging/messages/create', { userId: 'foo', text: 'test' @@ -817,7 +817,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('テã‚ストãŒç„¡ãã¦æ€’られる', async () => { + test('テã‚ストãŒç„¡ãã¦æ€’られる', async () => { const res = await api('/messaging/messages/create', { userId: bob.id }, alice); @@ -825,7 +825,7 @@ describe('API: Endpoints', () => { assert.strictEqual(res.status, 400); })); - it('æ–‡å—数オーãƒãƒ¼ã§æ€’られる', async () => { + test('æ–‡å—数オーãƒãƒ¼ã§æ€’られる', async () => { const res = await api('/messaging/messages/create', { userId: bob.id, text: '!'.repeat(1001) @@ -836,7 +836,7 @@ describe('API: Endpoints', () => { }); describe('notes/replies', () => { - it('自分ã«é–²è¦§æ¨©é™ã®ãªã„投稿ã¯å«ã¾ã‚Œãªã„', async () => { + test('自分ã«é–²è¦§æ¨©é™ã®ãªã„投稿ã¯å«ã¾ã‚Œãªã„', async () => { const alicePost = await post(alice, { text: 'foo' }); @@ -859,7 +859,7 @@ describe('API: Endpoints', () => { }); describe('notes/timeline', () => { - it('フォãƒãƒ¯ãƒ¼é™å®šæŠ•ç¨¿ãŒå«ã¾ã‚Œã‚‹', async () => { + test('フォãƒãƒ¯ãƒ¼é™å®šæŠ•ç¨¿ãŒå«ã¾ã‚Œã‚‹', async () => { await api('/following/create', { userId: alice.id }, bob); diff --git a/packages/backend/test/_e2e/fetch-resource.ts b/packages/backend/test/_e2e/fetch-resource.ts index 344022dec7..7ae133496a 100644 --- a/packages/backend/test/_e2e/fetch-resource.ts +++ b/packages/backend/test/_e2e/fetch-resource.ts @@ -35,38 +35,38 @@ describe('Fetch resource', () => { }); describe('Common', () => { - it('meta', async () => { + test('meta', async () => { const res = await request('/meta', { }); assert.strictEqual(res.status, 200); }); - it('GET root', async () => { + test('GET root', async () => { const res = await simpleGet('/'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); }); - it('GET docs', async () => { + test('GET docs', async () => { const res = await simpleGet('/docs/ja-JP/about'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); }); - it('GET api-doc', async () => { + test('GET api-doc', async () => { const res = await simpleGet('/api-doc'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); }); - it('GET api.json', async () => { + test('GET api.json', async () => { const res = await simpleGet('/api.json'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, JSON); }); - it('Validate api.json', async () => { + test('Validate api.json', async () => { const config = await openapi.loadConfig(); const result = await openapi.bundle({ config, @@ -80,25 +80,25 @@ describe('Fetch resource', () => { assert.strictEqual(result.problems.length, 0); }); - it('GET favicon.ico', async () => { + test('GET favicon.ico', async () => { const res = await simpleGet('/favicon.ico'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, 'image/x-icon'); }); - it('GET apple-touch-icon.png', async () => { + test('GET apple-touch-icon.png', async () => { const res = await simpleGet('/apple-touch-icon.png'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, 'image/png'); }); - it('GET twemoji svg', async () => { + test('GET twemoji svg', async () => { const res = await simpleGet('/twemoji/2764.svg'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, 'image/svg+xml'); }); - it('GET twemoji svg with hyphen', async () => { + test('GET twemoji svg with hyphen', async () => { const res = await simpleGet('/twemoji/2764-fe0f-200d-1f525.svg'); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, 'image/svg+xml'); @@ -106,25 +106,25 @@ describe('Fetch resource', () => { }); describe('/@:username', () => { - it('Only AP => AP', async () => { + test('Only AP => AP', async () => { const res = await simpleGet(`/@${alice.username}`, ONLY_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); }); - it('Prefer AP => AP', async () => { + test('Prefer AP => AP', async () => { const res = await simpleGet(`/@${alice.username}`, PREFER_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); }); - it('Prefer HTML => HTML', async () => { + test('Prefer HTML => HTML', async () => { const res = await simpleGet(`/@${alice.username}`, PREFER_HTML); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); }); - it('Unspecified => HTML', async () => { + test('Unspecified => HTML', async () => { const res = await simpleGet(`/@${alice.username}`, UNSPECIFIED); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); @@ -132,25 +132,25 @@ describe('Fetch resource', () => { }); describe('/users/:id', () => { - it('Only AP => AP', async () => { + test('Only AP => AP', async () => { const res = await simpleGet(`/users/${alice.id}`, ONLY_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); }); - it('Prefer AP => AP', async () => { + test('Prefer AP => AP', async () => { const res = await simpleGet(`/users/${alice.id}`, PREFER_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); }); - it('Prefer HTML => Redirect to /@:username', async () => { + test('Prefer HTML => Redirect to /@:username', async () => { const res = await simpleGet(`/users/${alice.id}`, PREFER_HTML); assert.strictEqual(res.status, 302); assert.strictEqual(res.location, `/@${alice.username}`); }); - it('Undecided => HTML', async () => { + test('Undecided => HTML', async () => { const res = await simpleGet(`/users/${alice.id}`, UNSPECIFIED); assert.strictEqual(res.status, 302); assert.strictEqual(res.location, `/@${alice.username}`); @@ -158,25 +158,25 @@ describe('Fetch resource', () => { }); describe('/notes/:id', () => { - it('Only AP => AP', async () => { + test('Only AP => AP', async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, ONLY_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); }); - it('Prefer AP => AP', async () => { + test('Prefer AP => AP', async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, PREFER_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); }); - it('Prefer HTML => HTML', async () => { + test('Prefer HTML => HTML', async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, PREFER_HTML); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); }); - it('Unspecified => HTML', async () => { + test('Unspecified => HTML', async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, UNSPECIFIED); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); @@ -184,19 +184,19 @@ describe('Fetch resource', () => { }); describe('Feeds', () => { - it('RSS', async () => { + test('RSS', async () => { const res = await simpleGet(`/@${alice.username}.rss`, UNSPECIFIED); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, 'application/rss+xml; charset=utf-8'); }); - it('ATOM', async () => { + test('ATOM', async () => { const res = await simpleGet(`/@${alice.username}.atom`, UNSPECIFIED); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, 'application/atom+xml; charset=utf-8'); }); - it('JSON', async () => { + test('JSON', async () => { const res = await simpleGet(`/@${alice.username}.json`, UNSPECIFIED); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, 'application/json; charset=utf-8'); diff --git a/packages/backend/test/_e2e/ff-visibility.ts b/packages/backend/test/_e2e/ff-visibility.ts index 38be0eba24..84a5b5ef28 100644 --- a/packages/backend/test/_e2e/ff-visibility.ts +++ b/packages/backend/test/_e2e/ff-visibility.ts @@ -22,7 +22,7 @@ describe('FF visibility', () => { await shutdownServer(p); }); - it('ffVisibility ㌠public ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’誰ã§ã‚‚見れる', async () => { + test('ffVisibility ㌠public ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’誰ã§ã‚‚見れる', async () => { await request('/i/update', { ffVisibility: 'public', }, alice); @@ -40,7 +40,7 @@ describe('FF visibility', () => { assert.strictEqual(Array.isArray(followersRes.body), true); }); - it('ffVisibility ㌠followers ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’自分ã§è¦‹ã‚Œã‚‹', async () => { + test('ffVisibility ㌠followers ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’自分ã§è¦‹ã‚Œã‚‹', async () => { await request('/i/update', { ffVisibility: 'followers', }, alice); @@ -58,7 +58,7 @@ describe('FF visibility', () => { assert.strictEqual(Array.isArray(followersRes.body), true); }); - it('ffVisibility ㌠followers ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { + test('ffVisibility ㌠followers ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’éžãƒ•ã‚©ãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œãªã„', async () => { await request('/i/update', { ffVisibility: 'followers', }, alice); @@ -74,7 +74,7 @@ describe('FF visibility', () => { assert.strictEqual(followersRes.status, 400); }); - it('ffVisibility ㌠followers ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’フォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { + test('ffVisibility ㌠followers ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’フォãƒãƒ¯ãƒ¼ãŒè¦‹ã‚Œã‚‹', async () => { await request('/i/update', { ffVisibility: 'followers', }, alice); @@ -96,7 +96,7 @@ describe('FF visibility', () => { assert.strictEqual(Array.isArray(followersRes.body), true); }); - it('ffVisibility ㌠private ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’自分ã§è¦‹ã‚Œã‚‹', async () => { + test('ffVisibility ㌠private ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’自分ã§è¦‹ã‚Œã‚‹', async () => { await request('/i/update', { ffVisibility: 'private', }, alice); @@ -114,7 +114,7 @@ describe('FF visibility', () => { assert.strictEqual(Array.isArray(followersRes.body), true); }); - it('ffVisibility ㌠private ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’他人ãŒè¦‹ã‚Œãªã„', async () => { + test('ffVisibility ㌠private ãªãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¼/フォãƒãƒ¯ãƒ¼ã‚’他人ãŒè¦‹ã‚Œãªã„', async () => { await request('/i/update', { ffVisibility: 'private', }, alice); @@ -131,7 +131,7 @@ describe('FF visibility', () => { }); describe('AP', () => { - it('ffVisibility ㌠public 以外ãªã‚‰ã°APã‹ã‚‰ã¯å–å¾—ã§ããªã„', async () => { + test('ffVisibility ㌠public 以外ãªã‚‰ã°APã‹ã‚‰ã¯å–å¾—ã§ããªã„', async () => { { await request('/i/update', { ffVisibility: 'public', diff --git a/packages/backend/test/_e2e/mute.ts b/packages/backend/test/_e2e/mute.ts index 2313773678..8f7f72bb97 100644 --- a/packages/backend/test/_e2e/mute.ts +++ b/packages/backend/test/_e2e/mute.ts @@ -23,7 +23,7 @@ describe('Mute', () => { await shutdownServer(p); }); - it('ミュート作æˆ', async () => { + test('ミュート作æˆ', async () => { const res = await request('/mute/create', { userId: carol.id, }, alice); @@ -31,7 +31,7 @@ describe('Mute', () => { assert.strictEqual(res.status, 204); }); - it('「自分宛ã¦ã®æŠ•ç¨¿ã€ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { + test('「自分宛ã¦ã®æŠ•ç¨¿ã€ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { const bobNote = await post(bob, { text: '@alice hi' }); const carolNote = await post(carol, { text: '@alice hi' }); @@ -43,7 +43,7 @@ describe('Mute', () => { assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); - it('ミュートã—ã¦ã„るユーザーã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€hasUnreadMentions ㌠true ã«ãªã‚‰ãªã„', async () => { + test('ミュートã—ã¦ã„るユーザーã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€hasUnreadMentions ㌠true ã«ãªã‚‰ãªã„', async () => { // 状態リセット await request('/i/read-all-unread-notes', {}, alice); @@ -55,7 +55,7 @@ describe('Mute', () => { assert.strictEqual(res.body.hasUnreadMentions, false); }); - it('ミュートã—ã¦ã„るユーザーã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€ã‚¹ãƒˆãƒªãƒ¼ãƒ ã« unreadMention イベントãŒæµã‚Œã¦ã“ãªã„', async () => { + test('ミュートã—ã¦ã„るユーザーã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€ã‚¹ãƒˆãƒªãƒ¼ãƒ ã« unreadMention イベントãŒæµã‚Œã¦ã“ãªã„', async () => { // 状態リセット await request('/i/read-all-unread-notes', {}, alice); @@ -64,7 +64,7 @@ describe('Mute', () => { assert.strictEqual(fired, false); }); - it('ミュートã—ã¦ã„るユーザーã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€ã‚¹ãƒˆãƒªãƒ¼ãƒ ã« unreadNotification イベントãŒæµã‚Œã¦ã“ãªã„', async () => { + test('ミュートã—ã¦ã„るユーザーã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€ã‚¹ãƒˆãƒªãƒ¼ãƒ ã« unreadNotification イベントãŒæµã‚Œã¦ã“ãªã„', async () => { // 状態リセット await request('/i/read-all-unread-notes', {}, alice); await request('/notifications/mark-all-as-read', {}, alice); @@ -75,7 +75,7 @@ describe('Mute', () => { }); describe('Timeline', () => { - it('タイムラインã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { + test('タイムラインã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { const aliceNote = await post(alice); const bobNote = await post(bob); const carolNote = await post(carol); @@ -89,7 +89,7 @@ describe('Mute', () => { assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); - it('タイムラインã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®æŠ•ç¨¿ã®RenoteãŒå«ã¾ã‚Œãªã„', async () => { + test('タイムラインã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®æŠ•ç¨¿ã®RenoteãŒå«ã¾ã‚Œãªã„', async () => { const aliceNote = await post(alice); const carolNote = await post(carol); const bobNote = await post(bob, { @@ -107,7 +107,7 @@ describe('Mute', () => { }); describe('Notification', () => { - it('通知ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®é€šçŸ¥ãŒå«ã¾ã‚Œãªã„(リアクション)', async () => { + test('通知ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーã®é€šçŸ¥ãŒå«ã¾ã‚Œãªã„(リアクション)', async () => { const aliceNote = await post(alice); await react(bob, aliceNote, 'like'); await react(carol, aliceNote, 'like'); diff --git a/packages/backend/test/_e2e/note.ts b/packages/backend/test/_e2e/note.ts index d75a5c8285..47af6808f6 100644 --- a/packages/backend/test/_e2e/note.ts +++ b/packages/backend/test/_e2e/note.ts @@ -24,7 +24,7 @@ describe('Note', () => { await shutdownServer(p); }); - it('投稿ã§ãã‚‹', async () => { + test('投稿ã§ãã‚‹', async () => { const post = { text: 'test', }; @@ -36,7 +36,7 @@ describe('Note', () => { assert.strictEqual(res.body.createdNote.text, post.text); }); - it('ファイルを添付ã§ãã‚‹', async () => { + test('ファイルを添付ã§ãã‚‹', async () => { const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); const res = await request('/notes/create', { @@ -48,7 +48,7 @@ describe('Note', () => { assert.deepStrictEqual(res.body.createdNote.fileIds, [file.id]); }, 1000 * 10); - it('他人ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¯ç„¡è¦–', async () => { + test('他人ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¯ç„¡è¦–', async () => { const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); const res = await request('/notes/create', { @@ -61,7 +61,7 @@ describe('Note', () => { assert.deepStrictEqual(res.body.createdNote.fileIds, []); }, 1000 * 10); - it('å˜åœ¨ã—ãªã„ファイルã¯ç„¡è¦–', async () => { + test('å˜åœ¨ã—ãªã„ファイルã¯ç„¡è¦–', async () => { const res = await request('/notes/create', { text: 'test', fileIds: ['000000000000000000000000'], @@ -72,7 +72,7 @@ describe('Note', () => { assert.deepStrictEqual(res.body.createdNote.fileIds, []); }); - it('ä¸æ£ãªãƒ•ã‚¡ã‚¤ãƒ«IDã¯ç„¡è¦–', async () => { + test('ä¸æ£ãªãƒ•ã‚¡ã‚¤ãƒ«IDã¯ç„¡è¦–', async () => { const res = await request('/notes/create', { fileIds: ['kyoppie'], }, alice); @@ -81,7 +81,7 @@ describe('Note', () => { assert.deepStrictEqual(res.body.createdNote.fileIds, []); }); - it('返信ã§ãã‚‹', async () => { + test('返信ã§ãã‚‹', async () => { const bobPost = await post(bob, { text: 'foo', }); @@ -100,7 +100,7 @@ describe('Note', () => { assert.strictEqual(res.body.createdNote.reply.text, bobPost.text); }); - it('renoteã§ãã‚‹', async () => { + test('renoteã§ãã‚‹', async () => { const bobPost = await post(bob, { text: 'test', }); @@ -117,7 +117,7 @@ describe('Note', () => { assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); }); - it('引用renoteã§ãã‚‹', async () => { + test('引用renoteã§ãã‚‹', async () => { const bobPost = await post(bob, { text: 'test', }); @@ -136,7 +136,7 @@ describe('Note', () => { assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); }); - it('æ–‡å—æ•°ãŽã‚ŠãŽã‚Šã§æ€’られãªã„', async () => { + test('æ–‡å—æ•°ãŽã‚ŠãŽã‚Šã§æ€’られãªã„', async () => { const post = { text: '!'.repeat(3000), }; @@ -144,7 +144,7 @@ describe('Note', () => { assert.strictEqual(res.status, 200); }); - it('æ–‡å—数オーãƒãƒ¼ã§æ€’られる', async () => { + test('æ–‡å—数オーãƒãƒ¼ã§æ€’られる', async () => { const post = { text: '!'.repeat(3001), }; @@ -152,7 +152,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('å˜åœ¨ã—ãªã„リプライ先ã§æ€’られる', async () => { + test('å˜åœ¨ã—ãªã„リプライ先ã§æ€’られる', async () => { const post = { text: 'test', replyId: '000000000000000000000000', @@ -161,7 +161,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('å˜åœ¨ã—ãªã„renote対象ã§æ€’られる', async () => { + test('å˜åœ¨ã—ãªã„renote対象ã§æ€’られる', async () => { const post = { renoteId: '000000000000000000000000', }; @@ -169,7 +169,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('ä¸æ£ãªãƒªãƒ—ライ先IDã§æ€’られる', async () => { + test('ä¸æ£ãªãƒªãƒ—ライ先IDã§æ€’られる', async () => { const post = { text: 'test', replyId: 'foo', @@ -178,7 +178,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('ä¸æ£ãªrenote対象IDã§æ€’られる', async () => { + test('ä¸æ£ãªrenote対象IDã§æ€’られる', async () => { const post = { renoteId: 'foo', }; @@ -186,7 +186,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('å˜åœ¨ã—ãªã„ユーザーã«ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã§ãã‚‹', async () => { + test('å˜åœ¨ã—ãªã„ユーザーã«ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã§ãã‚‹', async () => { const post = { text: '@ghost yo', }; @@ -198,7 +198,7 @@ describe('Note', () => { assert.strictEqual(res.body.createdNote.text, post.text); }); - it('åŒã˜ãƒ¦ãƒ¼ã‚¶ãƒ¼ã«è¤‡æ•°ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã—ã¦ã‚‚内部的ã«ã¾ã¨ã‚られる', async () => { + test('åŒã˜ãƒ¦ãƒ¼ã‚¶ãƒ¼ã«è¤‡æ•°ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã—ã¦ã‚‚内部的ã«ã¾ã¨ã‚られる', async () => { const post = { text: '@bob @bob @bob yo', }; @@ -214,7 +214,7 @@ describe('Note', () => { }); describe('notes/create', () => { - it('投票を添付ã§ãã‚‹', async () => { + test('投票を添付ã§ãã‚‹', async () => { const res = await request('/notes/create', { text: 'test', poll: { @@ -227,14 +227,14 @@ describe('Note', () => { assert.strictEqual(res.body.createdNote.poll != null, true); }); - it('投票ã®é¸æŠžè‚¢ãŒç„¡ãã¦æ€’られる', async () => { + test('投票ã®é¸æŠžè‚¢ãŒç„¡ãã¦æ€’られる', async () => { const res = await request('/notes/create', { poll: {}, }, alice); assert.strictEqual(res.status, 400); }); - it('投票ã®é¸æŠžè‚¢ãŒç„¡ãã¦æ€’られる (空ã®é…列)', async () => { + test('投票ã®é¸æŠžè‚¢ãŒç„¡ãã¦æ€’られる (空ã®é…列)', async () => { const res = await request('/notes/create', { poll: { choices: [], @@ -243,7 +243,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('投票ã®é¸æŠžè‚¢ãŒ1ã¤ã§æ€’られる', async () => { + test('投票ã®é¸æŠžè‚¢ãŒ1ã¤ã§æ€’られる', async () => { const res = await request('/notes/create', { poll: { choices: ['Strawberry Pasta'], @@ -252,7 +252,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('投票ã§ãã‚‹', async () => { + test('投票ã§ãã‚‹', async () => { const { body } = await request('/notes/create', { text: 'test', poll: { @@ -268,7 +268,7 @@ describe('Note', () => { assert.strictEqual(res.status, 204); }); - it('複数投票ã§ããªã„', async () => { + test('複数投票ã§ããªã„', async () => { const { body } = await request('/notes/create', { text: 'test', poll: { @@ -289,7 +289,7 @@ describe('Note', () => { assert.strictEqual(res.status, 400); }); - it('許å¯ã•ã‚Œã¦ã„ã‚‹å ´åˆã¯è¤‡æ•°æŠ•ç¥¨ã§ãã‚‹', async () => { + test('許å¯ã•ã‚Œã¦ã„ã‚‹å ´åˆã¯è¤‡æ•°æŠ•ç¥¨ã§ãã‚‹', async () => { const { body } = await request('/notes/create', { text: 'test', poll: { @@ -316,7 +316,7 @@ describe('Note', () => { assert.strictEqual(res.status, 204); }); - it('ç· ã‚切られã¦ã„ã‚‹å ´åˆã¯æŠ•ç¥¨ã§ããªã„', async () => { + test('ç· ã‚切られã¦ã„ã‚‹å ´åˆã¯æŠ•ç¥¨ã§ããªã„', async () => { const { body } = await request('/notes/create', { text: 'test', poll: { @@ -337,7 +337,7 @@ describe('Note', () => { }); describe('notes/delete', () => { - it('delete a reply', async () => { + test('delete a reply', async () => { const mainNoteRes = await api('notes/create', { text: 'main post', }, alice); diff --git a/packages/backend/test/_e2e/streaming.ts b/packages/backend/test/_e2e/streaming.ts index 4dad322e99..790451d9b4 100644 --- a/packages/backend/test/_e2e/streaming.ts +++ b/packages/backend/test/_e2e/streaming.ts @@ -78,7 +78,7 @@ describe('Streaming', () => { }); describe('Events', () => { - it('mention event', async () => { + test('mention event', async () => { const fired = await waitFire( kyoko, 'main', // kyoko:main () => post(ayano, { text: 'foo @kyoko bar' }), // ayano mention => kyoko @@ -88,7 +88,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('renote event', async () => { + test('renote event', async () => { const fired = await waitFire( kyoko, 'main', // kyoko:main () => post(ayano, { renoteId: kyokoNote.id }), // ayano renote @@ -100,7 +100,7 @@ describe('Streaming', () => { }); describe('Home Timeline', () => { - it('自分ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('自分ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'homeTimeline', // ayano:Home () => api('notes/create', { text: 'foo' }, ayano), // ayano posts @@ -110,7 +110,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„るユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„るユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'homeTimeline', // ayano:home () => api('notes/create', { text: 'foo' }, kyoko), // kyoko posts @@ -120,7 +120,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„ユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„ユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( kyoko, 'homeTimeline', // kyoko:home () => api('notes/create', { text: 'foo' }, ayano), // ayano posts @@ -130,7 +130,7 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - it('フォãƒãƒ¼ã—ã¦ã„るユーザーã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„るユーザーã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'homeTimeline', // ayano:home () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), // kyoko dm => ayano @@ -140,7 +140,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„るユーザーã§ã‚‚自分ãŒæŒ‡å®šã•ã‚Œã¦ã„ãªã„ダイレクト投稿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ã„るユーザーã§ã‚‚自分ãŒæŒ‡å®šã•ã‚Œã¦ã„ãªã„ダイレクト投稿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'homeTimeline', // ayano:home () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [chitose.id] }, kyoko), // kyoko dm => chitose @@ -152,7 +152,7 @@ describe('Streaming', () => { }); // Home describe('Local Timeline', () => { - it('自分ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('自分ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'localTimeline', // ayano:Local () => api('notes/create', { text: 'foo' }, ayano), // ayano posts @@ -162,7 +162,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'localTimeline', // ayano:Local () => api('notes/create', { text: 'foo' }, chitose), // chitose posts @@ -172,7 +172,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('リモートユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('リモートユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'localTimeline', // ayano:Local () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts @@ -182,7 +182,7 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - it('フォãƒãƒ¼ã—ã¦ãŸã¨ã—ã¦ã‚‚リモートユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ãŸã¨ã—ã¦ã‚‚リモートユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'localTimeline', // ayano:Local () => api('notes/create', { text: 'foo' }, akari), // akari posts @@ -192,7 +192,7 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - it('ホーム指定ã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('ホーム指定ã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'localTimeline', // ayano:Local () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), // kyoko home posts @@ -202,7 +202,7 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - it('フォãƒãƒ¼ã—ã¦ã„ã‚‹ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ã‚‹ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'localTimeline', // ayano:Local () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), // kyoko DM => ayano @@ -212,7 +212,7 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¯ãƒ¼å®›ã¦æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¯ãƒ¼å®›ã¦æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'localTimeline', // ayano:Local () => api('notes/create', { text: 'foo', visibility: 'followers' }, chitose), @@ -224,7 +224,7 @@ describe('Streaming', () => { }); describe('Hybrid Timeline', () => { - it('自分ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('自分ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo' }, ayano), // ayano posts @@ -234,7 +234,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo' }, chitose), // chitose posts @@ -244,7 +244,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„るリモートユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„るリモートユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo' }, akari), // akari posts @@ -254,7 +254,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„リモートユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„リモートユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts @@ -264,7 +264,7 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - it('フォãƒãƒ¼ã—ã¦ã„るユーザーã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„るユーザーã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), @@ -274,7 +274,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„るユーザーã®ãƒ›ãƒ¼ãƒ 投稿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„るユーザーã®ãƒ›ãƒ¼ãƒ 投稿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), @@ -284,7 +284,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ›ãƒ¼ãƒ 投稿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ›ãƒ¼ãƒ 投稿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo', visibility: 'home' }, chitose), @@ -294,7 +294,7 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¯ãƒ¼å®›ã¦æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®ãƒ•ã‚©ãƒãƒ¯ãƒ¼å®›ã¦æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid () => api('notes/create', { text: 'foo', visibility: 'followers' }, chitose), @@ -306,7 +306,7 @@ describe('Streaming', () => { }); describe('Global Timeline', () => { - it('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„ãƒãƒ¼ã‚«ãƒ«ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'globalTimeline', // ayano:Global () => api('notes/create', { text: 'foo' }, chitose), // chitose posts @@ -316,7 +316,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('フォãƒãƒ¼ã—ã¦ã„ãªã„リモートユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('フォãƒãƒ¼ã—ã¦ã„ãªã„リモートユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( ayano, 'globalTimeline', // ayano:Global () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts @@ -326,7 +326,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('ホーム投稿ã¯æµã‚Œãªã„', async () => { + test('ホーム投稿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( ayano, 'globalTimeline', // ayano:Global () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), // kyoko posts @@ -338,7 +338,7 @@ describe('Streaming', () => { }); describe('UserList Timeline', () => { - it('リストã«å…¥ã‚Œã¦ã„るユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('リストã«å…¥ã‚Œã¦ã„るユーザーã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( chitose, 'userList', () => api('notes/create', { text: 'foo' }, ayano), @@ -349,7 +349,7 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); - it('リストã«å…¥ã‚Œã¦ã„ãªã„ユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('リストã«å…¥ã‚Œã¦ã„ãªã„ユーザーã®æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( chitose, 'userList', () => api('notes/create', { text: 'foo' }, chinatsu), @@ -361,7 +361,7 @@ describe('Streaming', () => { }); // #4471 - it('リストã«å…¥ã‚Œã¦ã„るユーザーã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { + test('リストã«å…¥ã‚Œã¦ã„るユーザーã®ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆæŠ•ç¨¿ãŒæµã‚Œã‚‹', async () => { const fired = await waitFire( chitose, 'userList', () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [chitose.id] }, ayano), @@ -373,7 +373,7 @@ describe('Streaming', () => { }); // #4335 - it('リストã«å…¥ã‚Œã¦ã„ã‚‹ãŒãƒ•ã‚©ãƒãƒ¼ã¯ã—ã¦ãªã„ユーザーã®ãƒ•ã‚©ãƒãƒ¯ãƒ¼å®›ã¦æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { + test('リストã«å…¥ã‚Œã¦ã„ã‚‹ãŒãƒ•ã‚©ãƒãƒ¼ã¯ã—ã¦ãªã„ユーザーã®ãƒ•ã‚©ãƒãƒ¯ãƒ¼å®›ã¦æŠ•ç¨¿ã¯æµã‚Œãªã„', async () => { const fired = await waitFire( chitose, 'userList', () => api('notes/create', { text: 'foo', visibility: 'followers' }, kyoko), @@ -386,7 +386,7 @@ describe('Streaming', () => { }); describe('Hashtag Timeline', () => { - it('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', () => new Promise<void>(async done => { + test('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹', () => new Promise<void>(async done => { const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { if (type === 'note') { assert.deepStrictEqual(body.text, '#foo'); @@ -404,7 +404,7 @@ describe('Streaming', () => { }); })); - it('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹ (AND)', () => new Promise<void>(async done => { + test('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹ (AND)', () => new Promise<void>(async done => { let fooCount = 0; let barCount = 0; let fooBarCount = 0; @@ -442,7 +442,7 @@ describe('Streaming', () => { }, 3000); })); - it('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹ (OR)', () => new Promise<void>(async done => { + test('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹ (OR)', () => new Promise<void>(async done => { let fooCount = 0; let barCount = 0; let fooBarCount = 0; @@ -488,7 +488,7 @@ describe('Streaming', () => { }, 3000); })); - it('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹ (AND + OR)', () => new Promise<void>(async done => { + test('指定ã—ãŸãƒãƒƒã‚·ãƒ¥ã‚¿ã‚°ã®æŠ•ç¨¿ãŒæµã‚Œã‚‹ (AND + OR)', () => new Promise<void>(async done => { let fooCount = 0; let barCount = 0; let fooBarCount = 0; diff --git a/packages/backend/test/_e2e/thread-mute.ts b/packages/backend/test/_e2e/thread-mute.ts index 0ed9aa0666..890b52a8c1 100644 --- a/packages/backend/test/_e2e/thread-mute.ts +++ b/packages/backend/test/_e2e/thread-mute.ts @@ -22,7 +22,7 @@ describe('Note thread mute', () => { await shutdownServer(p); }); - it('notes/mentions ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るスレッドã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { + test('notes/mentions ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るスレッドã®æŠ•ç¨¿ãŒå«ã¾ã‚Œãªã„', async () => { const bobNote = await post(bob, { text: '@alice @carol root note' }); const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); @@ -40,7 +40,7 @@ describe('Note thread mute', () => { assert.strictEqual(res.body.some((note: any) => note.id === carolReplyWithoutMention.id), false); }); - it('ミュートã—ã¦ã„るスレッドã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€hasUnreadMentions ㌠true ã«ãªã‚‰ãªã„', async () => { + test('ミュートã—ã¦ã„るスレッドã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€hasUnreadMentions ㌠true ã«ãªã‚‰ãªã„', async () => { // 状態リセット await request('/i/read-all-unread-notes', {}, alice); @@ -56,7 +56,7 @@ describe('Note thread mute', () => { assert.strictEqual(res.body.hasUnreadMentions, false); }); - it('ミュートã—ã¦ã„るスレッドã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€ã‚¹ãƒˆãƒªãƒ¼ãƒ ã« unreadMention イベントãŒæµã‚Œã¦ã“ãªã„', () => new Promise(async done => { + test('ミュートã—ã¦ã„るスレッドã‹ã‚‰ãƒ¡ãƒ³ã‚·ãƒ§ãƒ³ã•ã‚Œã¦ã‚‚ã€ã‚¹ãƒˆãƒªãƒ¼ãƒ ã« unreadMention イベントãŒæµã‚Œã¦ã“ãªã„', () => new Promise(async done => { // 状態リセット await request('/i/read-all-unread-notes', {}, alice); @@ -82,7 +82,7 @@ describe('Note thread mute', () => { }, 5000); })); - it('i/notifications ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るスレッドã®é€šçŸ¥ãŒå«ã¾ã‚Œãªã„', async () => { + test('i/notifications ã«ãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るスレッドã®é€šçŸ¥ãŒå«ã¾ã‚Œãªã„', async () => { const bobNote = await post(bob, { text: '@alice @carol root note' }); const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); diff --git a/packages/backend/test/_e2e/user-notes.ts b/packages/backend/test/_e2e/user-notes.ts index 353875634c..a6cc1057f9 100644 --- a/packages/backend/test/_e2e/user-notes.ts +++ b/packages/backend/test/_e2e/user-notes.ts @@ -32,7 +32,7 @@ describe('users/notes', () => { await shutdownServer(p); }); - it('ファイルタイプ指定 (jpg)', async () => { + test('ファイルタイプ指定 (jpg)', async () => { const res = await request('/users/notes', { userId: alice.id, fileType: ['image/jpeg'], @@ -45,7 +45,7 @@ describe('users/notes', () => { assert.strictEqual(res.body.some((note: any) => note.id === jpgPngNote.id), true); }); - it('ファイルタイプ指定 (jpg or png)', async () => { + test('ファイルタイプ指定 (jpg or png)', async () => { const res = await request('/users/notes', { userId: alice.id, fileType: ['image/jpeg', 'image/png'], diff --git a/packages/backend/test/prelude/maybe.ts b/packages/backend/test/prelude/maybe.ts index c1ff63eada..b8679c1071 100644 --- a/packages/backend/test/prelude/maybe.ts +++ b/packages/backend/test/prelude/maybe.ts @@ -2,17 +2,17 @@ import * as assert from 'assert'; import { just, nothing } from '../../src/misc/prelude/maybe.js'; describe('just', () => { - it('has a value', () => { + test('has a value', () => { assert.deepStrictEqual(just(3).isJust(), true); }); - it('has the inverse called get', () => { + test('has the inverse called get', () => { assert.deepStrictEqual(just(3).get(), 3); }); }); describe('nothing', () => { - it('has no value', () => { + test('has no value', () => { assert.deepStrictEqual(nothing().isJust(), false); }); }); diff --git a/packages/backend/test/prelude/url.ts b/packages/backend/test/prelude/url.ts index 574f2fffdb..23b6b22bb0 100644 --- a/packages/backend/test/prelude/url.ts +++ b/packages/backend/test/prelude/url.ts @@ -2,7 +2,7 @@ import * as assert from 'assert'; import { query } from '../../src/misc/prelude/url.js'; describe('url', () => { - it('query', () => { + test('query', () => { const s = query({ foo: 'ãµã…', bar: 'b a r', diff --git a/packages/backend/test/tests/activitypub.ts b/packages/backend/test/tests/activitypub.ts index 08ec0a59ea..19fb5d90d7 100644 --- a/packages/backend/test/tests/activitypub.ts +++ b/packages/backend/test/tests/activitypub.ts @@ -27,7 +27,7 @@ describe('ActivityPub', () => { content: 'ã‚', }; - it('Minimum Actor', async () => { + test('Minimum Actor', async () => { const { MockResolver } = await import('../misc/mock-resolver.js'); const { createPerson } = await import('../../src/activitypub/models/person.js'); @@ -41,7 +41,7 @@ describe('ActivityPub', () => { assert.deepStrictEqual(user.inbox, actor.inbox); }); - it('Minimum Note', async () => { + test('Minimum Note', async () => { const { MockResolver } = await import('../misc/mock-resolver.js'); const { createNote } = await import('../../src/activitypub/models/note.js'); @@ -74,7 +74,7 @@ describe('ActivityPub', () => { outbox: `${actorId}/outbox`, }; - it('Actor', async () => { + test('Actor', async () => { const { MockResolver } = await import('../misc/mock-resolver.js'); const { createPerson } = await import('../../src/activitypub/models/person.js'); diff --git a/packages/backend/test/tests/ap-request.ts b/packages/backend/test/tests/ap-request.ts index d628f03f44..8c586861ad 100644 --- a/packages/backend/test/tests/ap-request.ts +++ b/packages/backend/test/tests/ap-request.ts @@ -19,7 +19,7 @@ export const buildParsedSignature = (signingString: string, signature: string, a }; describe('ap-request', () => { - it('createSignedPost with verify', async () => { + test('createSignedPost with verify', async () => { const keypair = await genRsaKeyPair(); const key = { keyId: 'x', 'privateKeyPem': keypair.privateKey }; const url = 'https://example.com/inbox'; @@ -37,7 +37,7 @@ describe('ap-request', () => { assert.deepStrictEqual(result, true); }); - it('createSignedGet with verify', async () => { + test('createSignedGet with verify', async () => { const keypair = await genRsaKeyPair(); const key = { keyId: 'x', 'privateKeyPem': keypair.privateKey }; const url = 'https://example.com/outbox'; diff --git a/packages/backend/test/tests/extract-mentions.ts b/packages/backend/test/tests/extract-mentions.ts index 4f9cb68763..e81d04c2db 100644 --- a/packages/backend/test/tests/extract-mentions.ts +++ b/packages/backend/test/tests/extract-mentions.ts @@ -4,7 +4,7 @@ import { parse } from 'mfm-js'; import { extractMentions } from '../../src/misc/extract-mentions.js'; describe('Extract mentions', () => { - it('simple', () => { + test('simple', () => { const ast = parse('@foo @bar @baz')!; const mentions = extractMentions(ast); assert.deepStrictEqual(mentions, [{ @@ -22,7 +22,7 @@ describe('Extract mentions', () => { }]); }); - it('nested', () => { + test('nested', () => { const ast = parse('@foo **@bar** @baz')!; const mentions = extractMentions(ast); assert.deepStrictEqual(mentions, [{ diff --git a/packages/backend/test/tests/mfm.ts b/packages/backend/test/tests/mfm.ts index 5087e84a1a..884f39d7fb 100644 --- a/packages/backend/test/tests/mfm.ts +++ b/packages/backend/test/tests/mfm.ts @@ -5,13 +5,13 @@ import { toHtml } from '../../src/mfm/to-html.js'; import { fromHtml } from '../../src/mfm/from-html.js'; describe('toHtml', () => { - it('br', () => { + test('br', () => { const input = 'foo\nbar\nbaz'; const output = '<p><span>foo<br>bar<br>baz</span></p>'; assert.equal(toHtml(mfm.parse(input)), output); }); - it('br alt', () => { + test('br alt', () => { const input = 'foo\r\nbar\rbaz'; const output = '<p><span>foo<br>bar<br>baz</span></p>'; assert.equal(toHtml(mfm.parse(input)), output); @@ -19,71 +19,71 @@ describe('toHtml', () => { }); describe('fromHtml', () => { - it('p', () => { + test('p', () => { assert.deepStrictEqual(fromHtml('<p>a</p><p>b</p>'), 'a\n\nb'); }); - it('block element', () => { + test('block element', () => { assert.deepStrictEqual(fromHtml('<div>a</div><div>b</div>'), 'a\nb'); }); - it('inline element', () => { + test('inline element', () => { assert.deepStrictEqual(fromHtml('<ul><li>a</li><li>b</li></ul>'), 'a\nb'); }); - it('block code', () => { + test('block code', () => { assert.deepStrictEqual(fromHtml('<pre><code>a\nb</code></pre>'), '```\na\nb\n```'); }); - it('inline code', () => { + test('inline code', () => { assert.deepStrictEqual(fromHtml('<code>a</code>'), '`a`'); }); - it('quote', () => { + test('quote', () => { assert.deepStrictEqual(fromHtml('<blockquote>a\nb</blockquote>'), '> a\n> b'); }); - it('br', () => { + test('br', () => { assert.deepStrictEqual(fromHtml('<p>abc<br><br/>d</p>'), 'abc\n\nd'); }); - it('link with different text', () => { + test('link with different text', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="https://example.com/b">c</a> d</p>'), 'a [c](https://example.com/b) d'); }); - it('link with different text, but not encoded', () => { + test('link with different text, but not encoded', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="https://example.com/ä">c</a> d</p>'), 'a [c](<https://example.com/ä>) d'); }); - it('link with same text', () => { + test('link with same text', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="https://example.com/b">https://example.com/b</a> d</p>'), 'a https://example.com/b d'); }); - it('link with same text, but not encoded', () => { + test('link with same text, but not encoded', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="https://example.com/ä">https://example.com/ä</a> d</p>'), 'a <https://example.com/ä> d'); }); - it('link with no url', () => { + test('link with no url', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="b">c</a> d</p>'), 'a [c](b) d'); }); - it('link without href', () => { + test('link without href', () => { assert.deepStrictEqual(fromHtml('<p>a <a>c</a> d</p>'), 'a c d'); }); - it('link without text', () => { + test('link without text', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="https://example.com/b"></a> d</p>'), 'a https://example.com/b d'); }); - it('link without both', () => { + test('link without both', () => { assert.deepStrictEqual(fromHtml('<p>a <a></a> d</p>'), 'a d'); }); - it('mention', () => { + test('mention', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="https://example.com/@user" class="u-url mention">@user</a> d</p>'), 'a @user@example.com d'); }); - it('hashtag', () => { + test('hashtag', () => { assert.deepStrictEqual(fromHtml('<p>a <a href="https://example.com/tags/a">#a</a> d</p>', ['#a']), 'a #a d'); }); }); diff --git a/packages/backend/test/tests/reaction-lib.ts b/packages/backend/test/tests/reaction-lib.ts index 7c61dc76c2..2e767f7697 100644 --- a/packages/backend/test/tests/reaction-lib.ts +++ b/packages/backend/test/tests/reaction-lib.ts @@ -4,79 +4,79 @@ import * as assert from 'assert'; import { toDbReaction } from '../src/misc/reaction-lib.js'; describe('toDbReaction', async () => { - it('æ—¢å˜ã®æ–‡å—列リアクションã¯ãã®ã¾ã¾', async () => { + test('æ—¢å˜ã®æ–‡å—列リアクションã¯ãã®ã¾ã¾', async () => { assert.strictEqual(await toDbReaction('like'), 'like'); }); - it('Unicodeプリンã¯å¯¿å¸åŒ–ä¸èƒ½ã¨ã™ã‚‹ãŸã‚æ–‡å—列化ã—ãªã„', async () => { + test('Unicodeプリンã¯å¯¿å¸åŒ–ä¸èƒ½ã¨ã™ã‚‹ãŸã‚æ–‡å—列化ã—ãªã„', async () => { assert.strictEqual(await toDbReaction('ðŸ®'), 'ðŸ®'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ like', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ like', async () => { assert.strictEqual(await toDbReaction('ðŸ‘'), 'like'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ love', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ love', async () => { assert.strictEqual(await toDbReaction('â¤ï¸'), 'love'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ love 異体å—セレクタãªã—', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ love 異体å—セレクタãªã—', async () => { assert.strictEqual(await toDbReaction('â¤'), 'love'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ laugh', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ laugh', async () => { assert.strictEqual(await toDbReaction('😆'), 'laugh'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ hmm', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ hmm', async () => { assert.strictEqual(await toDbReaction('🤔'), 'hmm'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ surprise', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ surprise', async () => { assert.strictEqual(await toDbReaction('😮'), 'surprise'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ congrats', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ congrats', async () => { assert.strictEqual(await toDbReaction('🎉'), 'congrats'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ angry', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ angry', async () => { assert.strictEqual(await toDbReaction('💢'), 'angry'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ confused', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ confused', async () => { assert.strictEqual(await toDbReaction('😥'), 'confused'); }); - it('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ rip', async () => { + test('プリン以外ã®æ—¢å˜ã®ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¯æ–‡å—列化ã™ã‚‹ rip', async () => { assert.strictEqual(await toDbReaction('😇'), 'rip'); }); - it('ãれ以外ã¯Unicodeã®ã¾ã¾', async () => { + test('ãれ以外ã¯Unicodeã®ã¾ã¾', async () => { assert.strictEqual(await toDbReaction('ðŸ…'), 'ðŸ…'); }); - it('異体å—セレクタ除去', async () => { + test('異体å—セレクタ除去', async () => { assert.strictEqual(await toDbReaction('㊗ï¸'), '㊗'); }); - it('異体å—セレクタ除去 å¿…è¦ãªã—', async () => { + test('異体å—セレクタ除去 å¿…è¦ãªã—', async () => { assert.strictEqual(await toDbReaction('㊗'), '㊗'); }); - it('fallback - undefined', async () => { + test('fallback - undefined', async () => { assert.strictEqual(await toDbReaction(undefined), 'like'); }); - it('fallback - null', async () => { + test('fallback - null', async () => { assert.strictEqual(await toDbReaction(null), 'like'); }); - it('fallback - empty', async () => { + test('fallback - empty', async () => { assert.strictEqual(await toDbReaction(''), 'like'); }); - it('fallback - unknown', async () => { + test('fallback - unknown', async () => { assert.strictEqual(await toDbReaction('unknown'), 'like'); }); }); diff --git a/packages/backend/test/unit/FileInfoService.ts b/packages/backend/test/unit/FileInfoService.ts index b876deb545..d05833560d 100644 --- a/packages/backend/test/unit/FileInfoService.ts +++ b/packages/backend/test/unit/FileInfoService.ts @@ -54,7 +54,7 @@ describe('FileInfoService', () => { await app.close(); }); - it('Empty file', async () => { + test('Empty file', async () => { const path = `${resources}/emptyfile`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; @@ -74,7 +74,7 @@ describe('FileInfoService', () => { }); }); - it('Generic JPEG', async () => { + test('Generic JPEG', async () => { const path = `${resources}/Lenna.jpg`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; @@ -94,7 +94,7 @@ describe('FileInfoService', () => { }); }); - it('Generic APNG', async () => { + test('Generic APNG', async () => { const path = `${resources}/anime.png`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; @@ -114,7 +114,7 @@ describe('FileInfoService', () => { }); }); - it('Generic AGIF', async () => { + test('Generic AGIF', async () => { const path = `${resources}/anime.gif`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; @@ -134,7 +134,7 @@ describe('FileInfoService', () => { }); }); - it('PNG with alpha', async () => { + test('PNG with alpha', async () => { const path = `${resources}/with-alpha.png`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; @@ -154,7 +154,7 @@ describe('FileInfoService', () => { }); }); - it('Generic SVG', async () => { + test('Generic SVG', async () => { const path = `${resources}/image.svg`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; @@ -174,7 +174,7 @@ describe('FileInfoService', () => { }); }); - it('SVG with XML definition', async () => { + test('SVG with XML definition', async () => { // https://github.com/misskey-dev/misskey/issues/4413 const path = `${resources}/with-xml-def.svg`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; @@ -195,7 +195,7 @@ describe('FileInfoService', () => { }); }); - it('Dimension limit', async () => { + test('Dimension limit', async () => { const path = `${resources}/25000x25000.png`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; @@ -215,7 +215,7 @@ describe('FileInfoService', () => { }); }); - it('Rotate JPEG', async () => { + test('Rotate JPEG', async () => { const path = `${resources}/rotate.jpg`; const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; delete info.warnings; diff --git a/packages/backend/test/unit/MetaService.ts b/packages/backend/test/unit/MetaService.ts index 26649d92a4..9efd8bbe70 100644 --- a/packages/backend/test/unit/MetaService.ts +++ b/packages/backend/test/unit/MetaService.ts @@ -35,7 +35,7 @@ describe('MetaService', () => { await app.close(); }); - it('fetch (cache)', async () => { + test('fetch (cache)', async () => { const db = app.get<DataSource>(DI.db); const spy = jest.spyOn(db, 'transaction'); @@ -45,7 +45,7 @@ describe('MetaService', () => { expect(spy).toHaveBeenCalledTimes(0); }); - it('fetch (force)', async () => { + test('fetch (force)', async () => { const db = app.get<DataSource>(DI.db); const spy = jest.spyOn(db, 'transaction'); diff --git a/packages/backend/test/unit/RelayService.ts b/packages/backend/test/unit/RelayService.ts index 5f87fea7aa..529e923b2c 100644 --- a/packages/backend/test/unit/RelayService.ts +++ b/packages/backend/test/unit/RelayService.ts @@ -57,7 +57,7 @@ describe('RelayService', () => { await app.close(); }); - it('addRelay', async () => { + test('addRelay', async () => { const result = await relayService.addRelay('https://example.com'); expect(result.inbox).toBe('https://example.com'); @@ -68,7 +68,7 @@ describe('RelayService', () => { //expect(queueService.deliver.mock.lastCall![0].username).toBe('relay.actor'); }); - it('listRelay', async () => { + test('listRelay', async () => { const result = await relayService.listRelay(); expect(result.length).toBe(1); @@ -76,7 +76,7 @@ describe('RelayService', () => { expect(result[0].status).toBe('requesting'); }); - it('removeRelay: succ', async () => { + test('removeRelay: succ', async () => { await relayService.removeRelay('https://example.com'); expect(queueService.deliver).toHaveBeenCalled(); @@ -89,7 +89,7 @@ describe('RelayService', () => { expect(list.length).toBe(0); }); - it('removeRelay: fail', async () => { + test('removeRelay: fail', async () => { await expect(relayService.removeRelay('https://x.example.com')) .rejects.toThrow('relay not found'); }); diff --git a/packages/backend/test/unit/RoleService.ts b/packages/backend/test/unit/RoleService.ts index c4011593be..221f743d3a 100644 --- a/packages/backend/test/unit/RoleService.ts +++ b/packages/backend/test/unit/RoleService.ts @@ -102,7 +102,7 @@ describe('RoleService', () => { }); describe('getUserPolicies', () => { - it('instance default policies', async () => { + test('instance default policies', async () => { const user = await createUser(); metaService.fetch.mockResolvedValue({ policies: { @@ -115,7 +115,7 @@ describe('RoleService', () => { expect(result.canManageCustomEmojis).toBe(false); }); - it('instance default policies 2', async () => { + test('instance default policies 2', async () => { const user = await createUser(); metaService.fetch.mockResolvedValue({ policies: { @@ -128,7 +128,7 @@ describe('RoleService', () => { expect(result.canManageCustomEmojis).toBe(true); }); - it('with role', async () => { + test('with role', async () => { const user = await createUser(); const role = await createRole({ name: 'a', @@ -152,7 +152,7 @@ describe('RoleService', () => { expect(result.canManageCustomEmojis).toBe(true); }); - it('priority', async () => { + test('priority', async () => { const user = await createUser(); const role1 = await createRole({ name: 'role1', @@ -187,7 +187,7 @@ describe('RoleService', () => { expect(result.driveCapacityMb).toBe(100); }); - it('conditional role', async () => { + test('conditional role', async () => { const user1 = await createUser({ createdAt: new Date(Date.now() - (1000 * 60 * 60 * 24 * 365)), }); diff --git a/packages/backend/test/unit/chart.ts b/packages/backend/test/unit/chart.ts index 036d0e19fd..1e9a51bc88 100644 --- a/packages/backend/test/unit/chart.ts +++ b/packages/backend/test/unit/chart.ts @@ -78,7 +78,7 @@ describe('Chart', () => { if (db) await db.destroy(); }); - it('Can updates', async () => { + test('Can updates', async () => { await testChart.increment(); await testChart.save(); @@ -102,7 +102,7 @@ describe('Chart', () => { }); }); - it('Can updates (dec)', async () => { + test('Can updates (dec)', async () => { await testChart.decrement(); await testChart.save(); @@ -126,7 +126,7 @@ describe('Chart', () => { }); }); - it('Empty chart', async () => { + test('Empty chart', async () => { const chartHours = await testChart.getChart('hour', 3, null); const chartDays = await testChart.getChart('day', 3, null); @@ -147,7 +147,7 @@ describe('Chart', () => { }); }); - it('Can updates at multiple times at same time', async () => { + test('Can updates at multiple times at same time', async () => { await testChart.increment(); await testChart.increment(); await testChart.increment(); @@ -173,7 +173,7 @@ describe('Chart', () => { }); }); - it('複数回saveã•ã‚Œã¦ã‚‚データã®æ›´æ–°ã¯ä¸€åº¦ã ã‘', async () => { + test('複数回saveã•ã‚Œã¦ã‚‚データã®æ›´æ–°ã¯ä¸€åº¦ã ã‘', async () => { await testChart.increment(); await testChart.save(); await testChart.save(); @@ -199,7 +199,7 @@ describe('Chart', () => { }); }); - it('Can updates at different times', async () => { + test('Can updates at different times', async () => { await testChart.increment(); await testChart.save(); @@ -230,7 +230,7 @@ describe('Chart', () => { // 仕様上ã¯ã“ã†ãªã£ã¦ã»ã—ã„ã‘ã©ã€å®Ÿè£…ã¯é›£ã—ãã†ãªã®ã§skip /* - it('Can updates at different times without save', async () => { + test('Can updates at different times without save', async () => { await testChart.increment(); clock.tick('01:00:00'); @@ -259,7 +259,7 @@ describe('Chart', () => { }); */ - it('Can padding', async () => { + test('Can padding', async () => { await testChart.increment(); await testChart.save(); @@ -289,7 +289,7 @@ describe('Chart', () => { }); // è¦æ±‚ã•ã‚ŒãŸç¯„囲ã«ãƒã‚°ãŒã²ã¨ã¤ã‚‚ãªã„å ´åˆã§ã‚‚パディングã§ãã‚‹ - it('Can padding from past range', async () => { + test('Can padding from past range', async () => { await testChart.increment(); await testChart.save(); @@ -317,7 +317,7 @@ describe('Chart', () => { // è¦æ±‚ã•ã‚ŒãŸç¯„囲ã®æœ€ã‚‚å¤ã„箇所ã«ä½ç½®ã™ã‚‹ãƒã‚°ãŒå˜åœ¨ã—ãªã„å ´åˆã§ã‚‚パディングã§ãã‚‹ // Issue #3190 - it('Can padding from past range 2', async () => { + test('Can padding from past range 2', async () => { await testChart.increment(); await testChart.save(); @@ -346,7 +346,7 @@ describe('Chart', () => { }); }); - it('Can specify offset', async () => { + test('Can specify offset', async () => { await testChart.increment(); await testChart.save(); @@ -375,7 +375,7 @@ describe('Chart', () => { }); }); - it('Can specify offset (floor time)', async () => { + test('Can specify offset (floor time)', async () => { clock.tick('00:30:00'); await testChart.increment(); @@ -407,7 +407,7 @@ describe('Chart', () => { }); describe('Grouped', () => { - it('Can updates', async () => { + test('Can updates', async () => { await testGroupedChart.increment('alice'); await testGroupedChart.save(); @@ -451,7 +451,7 @@ describe('Chart', () => { }); describe('Unique increment', () => { - it('Can updates', async () => { + test('Can updates', async () => { await testUniqueChart.uniqueIncrement('alice'); await testUniqueChart.uniqueIncrement('alice'); await testUniqueChart.uniqueIncrement('bob'); @@ -470,7 +470,7 @@ describe('Chart', () => { }); describe('Intersection', () => { - it('æ¡ä»¶ãŒæº€ãŸã•ã‚Œã¦ã„ãªã„å ´åˆã¯ã‚«ã‚¦ãƒ³ãƒˆã•ã‚Œãªã„', async () => { + test('æ¡ä»¶ãŒæº€ãŸã•ã‚Œã¦ã„ãªã„å ´åˆã¯ã‚«ã‚¦ãƒ³ãƒˆã•ã‚Œãªã„', async () => { await testIntersectionChart.addA('alice'); await testIntersectionChart.addA('bob'); await testIntersectionChart.addB('carol'); @@ -492,7 +492,7 @@ describe('Chart', () => { }); }); - it('æ¡ä»¶ãŒæº€ãŸã•ã‚Œã¦ã„ã‚‹å ´åˆã«ã‚«ã‚¦ãƒ³ãƒˆã•ã‚Œã‚‹', async () => { + test('æ¡ä»¶ãŒæº€ãŸã•ã‚Œã¦ã„ã‚‹å ´åˆã«ã‚«ã‚¦ãƒ³ãƒˆã•ã‚Œã‚‹', async () => { await testIntersectionChart.addA('alice'); await testIntersectionChart.addA('bob'); await testIntersectionChart.addB('carol'); @@ -518,7 +518,7 @@ describe('Chart', () => { }); describe('Resync', () => { - it('Can resync', async () => { + test('Can resync', async () => { testChart.total = 1; await testChart.resync(); @@ -543,7 +543,7 @@ describe('Chart', () => { }); }); - it('Can resync (2)', async () => { + test('Can resync (2)', async () => { await testChart.increment(); await testChart.save(); -- GitLab