@@ -12,47 +12,38 @@ describe('files-regular/utils', () => {
12
12
describe ( 'parseChunkerString' , ( ) => {
13
13
it ( 'handles an empty string' , ( ) => {
14
14
const options = utils . parseChunkerString ( '' )
15
- expect ( options ) . to . have . property ( ' chunker' ) . to . equal ( 'fixed' )
15
+ expect ( options . chunker ) . to . equal ( 'fixed' )
16
16
} )
17
17
18
18
it ( 'handles a null chunker string' , ( ) => {
19
19
const options = utils . parseChunkerString ( null )
20
- expect ( options ) . to . have . property ( ' chunker' ) . to . equal ( 'fixed' )
20
+ expect ( options . chunker ) . to . equal ( 'fixed' )
21
21
} )
22
22
23
23
it ( 'parses a fixed size string' , ( ) => {
24
24
const options = utils . parseChunkerString ( 'size-512' )
25
- expect ( options ) . to . have . property ( 'chunker' ) . to . equal ( 'fixed' )
26
- expect ( options )
27
- . to . have . property ( 'chunkerOptions' )
28
- . to . have . property ( 'maxChunkSize' )
29
- . to . equal ( 512 )
25
+ expect ( options . chunker ) . to . equal ( 'fixed' )
26
+ expect ( options . chunkerOptions . maxChunkSize ) . to . equal ( 512 )
30
27
} )
31
28
32
29
it ( 'parses a rabin string without size' , ( ) => {
33
30
const options = utils . parseChunkerString ( 'rabin' )
34
- expect ( options ) . to . have . property ( 'chunker' ) . to . equal ( 'rabin' )
35
- expect ( options )
36
- . to . have . property ( 'chunkerOptions' )
37
- . to . have . property ( 'avgChunkSize' )
31
+ expect ( options . chunker ) . to . equal ( 'rabin' )
32
+ expect ( options . chunkerOptions . avgChunkSize ) . to . equal ( 262144 )
38
33
} )
39
34
40
35
it ( 'parses a rabin string with only avg size' , ( ) => {
41
36
const options = utils . parseChunkerString ( 'rabin-512' )
42
- expect ( options ) . to . have . property ( 'chunker' ) . to . equal ( 'rabin' )
43
- expect ( options )
44
- . to . have . property ( 'chunkerOptions' )
45
- . to . have . property ( 'avgChunkSize' )
46
- . to . equal ( 512 )
37
+ expect ( options . chunker ) . to . equal ( 'rabin' )
38
+ expect ( options . chunkerOptions . avgChunkSize ) . to . equal ( 512 )
47
39
} )
48
40
49
41
it ( 'parses a rabin string with min, avg, and max' , ( ) => {
50
42
const options = utils . parseChunkerString ( 'rabin-42-92-184' )
51
- expect ( options ) . to . have . property ( 'chunker' ) . to . equal ( 'rabin' )
52
- expect ( options ) . to . have . property ( 'chunkerOptions' )
53
- expect ( options . chunkerOptions ) . to . have . property ( 'minChunkSize' ) . to . equal ( 42 )
54
- expect ( options . chunkerOptions ) . to . have . property ( 'avgChunkSize' ) . to . equal ( 92 )
55
- expect ( options . chunkerOptions ) . to . have . property ( 'maxChunkSize' ) . to . equal ( 184 )
43
+ expect ( options . chunker ) . to . equal ( 'rabin' )
44
+ expect ( options . chunkerOptions . minChunkSize ) . to . equal ( 42 )
45
+ expect ( options . chunkerOptions . avgChunkSize ) . to . equal ( 92 )
46
+ expect ( options . chunkerOptions . maxChunkSize ) . to . equal ( 184 )
56
47
} )
57
48
58
49
it ( 'throws an error for unsupported chunker type' , ( ) => {
0 commit comments