44 */
55
66import type { Attribute , NodeData } from '../../lib/node/index.ts'
7+ import type { TNodeStatus } from '../../lib/node/node.ts'
78
89import { describe , expect , test } from 'vitest'
910import { File , Folder , NodeStatus } from '../../lib/node/index.ts'
@@ -343,8 +344,10 @@ describe('Sanity checks', () => {
343344 displayname : 'test' ,
344345 owner : 'emma' ,
345346 } )
346- // @ts -expect-error wrong type error check
347- expect ( ( ) => { file . displayname = true } ) . toThrowError ( 'Invalid displayname' )
347+ expect ( ( ) => {
348+ // @ts -expect-error wrong type error check
349+ file . displayname = true
350+ } ) . toThrowError ( 'Invalid displayname' )
348351 } )
349352
350353 test ( 'Invalid mtime' , ( ) => {
@@ -360,8 +363,10 @@ describe('Sanity checks', () => {
360363 root : '/files/emma' ,
361364 owner : 'emma' ,
362365 } )
363- // @ts -expect-error wrong type error check
364- expect ( ( ) => { file . mtime = 'invalid' } ) . toThrowError ( 'Invalid mtime type' )
366+ expect ( ( ) => {
367+ // @ts -expect-error wrong type error check
368+ file . mtime = 'invalid'
369+ } ) . toThrowError ( 'Invalid mtime type' )
365370 } )
366371
367372 test ( 'Invalid crtime' , ( ) => {
@@ -388,9 +393,13 @@ describe('Sanity checks', () => {
388393 mime : 'image/jpeg' ,
389394 owner : 'emma' ,
390395 } )
391- // @ts -expect-error wrong type error check
392- expect ( ( ) => { file . mime = 1234 } ) . toThrowError ( 'Missing or invalid mandatory mime' )
393- expect ( ( ) => { file . mime = 'image' } ) . toThrowError ( 'Missing or invalid mandatory mime' )
396+ expect ( ( ) => {
397+ // @ts -expect-error wrong type error check
398+ file . mime = 1234
399+ } ) . toThrowError ( 'Missing or invalid mandatory mime' )
400+ expect ( ( ) => {
401+ file . mime = 'image'
402+ } ) . toThrowError ( 'Missing or invalid mandatory mime' )
394403 } )
395404
396405 test ( 'Invalid attributes' , ( ) => {
@@ -485,7 +494,7 @@ describe('Sanity checks', () => {
485494 root : '/files/emma' ,
486495 mime : 'image/jpeg' ,
487496 owner : 'emma' ,
488- status : 'invalid' as unknown as NodeStatus ,
497+ status : 'invalid' as unknown as TNodeStatus ,
489498 } ) ) . toThrowError ( 'Status must be a valid NodeStatus' )
490499
491500 const file = new File ( {
0 commit comments