From 8e526c23f65972635a1f5e9de299a903839f3e25 Mon Sep 17 00:00:00 2001 From: rinsuki <428rinsuki+git@gmail.com> Date: Fri, 25 Oct 2019 05:48:54 +0900 Subject: [PATCH] fix compile errors --- src/services/chart/core.ts | 2 +- test/mute.ts | 20 ++++++++++---------- test/note.ts | 4 ++-- test/user-notes.ts | 10 +++++----- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/services/chart/core.ts b/src/services/chart/core.ts index 9dc250f753..14f7f6574f 100644 --- a/src/services/chart/core.ts +++ b/src/services/chart/core.ts @@ -4,7 +4,7 @@ * Tests located in test/chart */ -import * as nestedProperty from 'nested-property'; +const nestedProperty = require('nested-property'); import autobind from 'autobind-decorator'; import Logger from '../logger'; import { Schema } from '../../misc/schema'; diff --git a/test/mute.ts b/test/mute.ts index 07c77f7623..ff1a441449 100644 --- a/test/mute.ts +++ b/test/mute.ts @@ -62,8 +62,8 @@ describe('Mute', () => { assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); })); it('ミュートしているユーザーからメンションされても、hasUnreadMentions が true にならない', async(async () => { @@ -131,9 +131,9 @@ describe('Mute', () => { assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); })); it('タイムラインにミュートしているユーザーの投稿のRenoteが含まれない', async(async () => { @@ -147,9 +147,9 @@ describe('Mute', () => { assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); })); }); @@ -163,8 +163,8 @@ describe('Mute', () => { assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(notification => notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => notification.userId === carol.id), false); + assert.strictEqual(res.body.some((notification: any) => notification.userId === bob.id), true); + assert.strictEqual(res.body.some((notification: any) => notification.userId === carol.id), false); })); }); }); diff --git a/test/note.ts b/test/note.ts index 4a4a777340..b886535108 100644 --- a/test/note.ts +++ b/test/note.ts @@ -17,8 +17,8 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, uploadFile } from './utils'; -import { Note } from '../built/models/entities/note'; -const initDb = require('../built/db/postgre.js').initDb; +import { Note } from '../src/models/entities/note'; +import { initDb } from '../src/db/postgre'; describe('Note', () => { let p: childProcess.ChildProcess; diff --git a/test/user-notes.ts b/test/user-notes.ts index 63a97cd805..3f11f66f96 100644 --- a/test/user-notes.ts +++ b/test/user-notes.ts @@ -66,8 +66,8 @@ describe('users/notes', () => { assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); assert.strictEqual(res.body.length, 2); - assert.strictEqual(res.body.some(note => note.id === jpgNote.id), true); - assert.strictEqual(res.body.some(note => note.id === jpgPngNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === jpgNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === jpgPngNote.id), true); })); it('ファイルタイプ指定 (jpg or png)', async(async () => { @@ -79,8 +79,8 @@ describe('users/notes', () => { assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); assert.strictEqual(res.body.length, 3); - assert.strictEqual(res.body.some(note => note.id === jpgNote.id), true); - assert.strictEqual(res.body.some(note => note.id === pngNote.id), true); - assert.strictEqual(res.body.some(note => note.id === jpgPngNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === jpgNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === pngNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === jpgPngNote.id), true); })); });