Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
c1f96704
Commit
c1f96704
authored
1 year ago
by
S Kopper
Browse files
Options
Downloads
Patches
Plain Diff
fix: FileInfoService unit test
parent
36c136cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/backend/test/unit/FileInfoService.ts
+14
-14
14 additions, 14 deletions
packages/backend/test/unit/FileInfoService.ts
with
14 additions
and
14 deletions
packages/backend/test/unit/FileInfoService.ts
+
14
−
14
View file @
c1f96704
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -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;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment