Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
fix: FileInfoService unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
wont-work committed Nov 5, 2023
1 parent 1940366 commit 5cc7ecf
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/backend/test/unit/FileInfoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('FileInfoService', () => {

test('Empty file', async () => {
const path = `${resources}/emptyfile`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -77,7 +77,7 @@ describe('FileInfoService', () => {
describe('IMAGE', () => {
test('Generic JPEG', async () => {
const path = `${resources}/Lenna.jpg`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -97,7 +97,7 @@ describe('FileInfoService', () => {

test('Generic APNG', async () => {
const path = `${resources}/anime.png`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -117,7 +117,7 @@ describe('FileInfoService', () => {

test('Generic AGIF', async () => {
const path = `${resources}/anime.gif`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -137,7 +137,7 @@ describe('FileInfoService', () => {

test('PNG with alpha', async () => {
const path = `${resources}/with-alpha.png`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -157,7 +157,7 @@ describe('FileInfoService', () => {

test('Generic SVG', async () => {
const path = `${resources}/image.svg`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -178,7 +178,7 @@ describe('FileInfoService', () => {
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;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -198,7 +198,7 @@ describe('FileInfoService', () => {

test('Dimension limit', async () => {
const path = `${resources}/25000x25000.png`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -218,7 +218,7 @@ describe('FileInfoService', () => {

test('Rotate JPEG', async () => {
const path = `${resources}/rotate.jpg`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -240,7 +240,7 @@ describe('FileInfoService', () => {
describe('AUDIO', () => {
test('MP3', async () => {
const path = `${resources}/kick_gaba7.mp3`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -260,7 +260,7 @@ describe('FileInfoService', () => {

test('WAV', async () => {
const path = `${resources}/kick_gaba7.wav`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -280,7 +280,7 @@ describe('FileInfoService', () => {

test('AAC', async () => {
const path = `${resources}/kick_gaba7.aac`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -300,7 +300,7 @@ describe('FileInfoService', () => {

test('FLAC', async () => {
const path = `${resources}/kick_gaba7.flac`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand All @@ -322,7 +322,7 @@ describe('FileInfoService', () => {
* video/webmとして検出されてしまう
test('WEBM AUDIO', async () => {
const path = `${resources}/kick_gaba7.webm`;
const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any;
const info = await fileInfoService.getFileInfo(path) as any;
delete info.warnings;
delete info.blurhash;
delete info.sensitive;
Expand Down

0 comments on commit 5cc7ecf

Please sign in to comment.