@@ -32,7 +32,18 @@ describe('chmod', () => {
32
32
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
33
33
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
34
34
path ,
35
- parseInt ( mode , 8 ) ,
35
+ mode ,
36
+ defaultOptions
37
+ ] )
38
+ } )
39
+
40
+ it ( 'should update the mode for a file with a string' , async ( ) => {
41
+ await cli ( `files chmod +x ${ path } ` , { ipfs } )
42
+
43
+ expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
44
+ expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
45
+ path ,
46
+ '+x' ,
36
47
defaultOptions
37
48
] )
38
49
} )
@@ -43,7 +54,7 @@ describe('chmod', () => {
43
54
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
44
55
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
45
56
path ,
46
- parseInt ( mode , 8 ) , {
57
+ mode , {
47
58
...defaultOptions ,
48
59
recursive : true
49
60
}
@@ -56,7 +67,7 @@ describe('chmod', () => {
56
67
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
57
68
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
58
69
path ,
59
- parseInt ( mode , 8 ) , {
70
+ mode , {
60
71
...defaultOptions ,
61
72
recursive : true
62
73
}
@@ -69,7 +80,7 @@ describe('chmod', () => {
69
80
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
70
81
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
71
82
path ,
72
- parseInt ( mode , 8 ) , {
83
+ mode , {
73
84
...defaultOptions ,
74
85
flush : false
75
86
}
@@ -82,7 +93,7 @@ describe('chmod', () => {
82
93
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
83
94
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
84
95
path ,
85
- parseInt ( mode , 8 ) , {
96
+ mode , {
86
97
...defaultOptions ,
87
98
flush : false
88
99
}
@@ -95,7 +106,7 @@ describe('chmod', () => {
95
106
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
96
107
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
97
108
path ,
98
- parseInt ( mode , 8 ) , {
109
+ mode , {
99
110
...defaultOptions ,
100
111
hashAlg : 'sha3-256'
101
112
}
@@ -108,7 +119,7 @@ describe('chmod', () => {
108
119
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
109
120
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
110
121
path ,
111
- parseInt ( mode , 8 ) , {
122
+ mode , {
112
123
...defaultOptions ,
113
124
hashAlg : 'sha3-256'
114
125
}
@@ -121,7 +132,7 @@ describe('chmod', () => {
121
132
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
122
133
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
123
134
path ,
124
- parseInt ( mode , 8 ) , {
135
+ mode , {
125
136
...defaultOptions ,
126
137
shardSplitThreshold : 10
127
138
}
@@ -134,7 +145,7 @@ describe('chmod', () => {
134
145
expect ( ipfs . files . chmod . callCount ) . to . equal ( 1 )
135
146
expect ( ipfs . files . chmod . getCall ( 0 ) . args ) . to . deep . equal ( [
136
147
path ,
137
- parseInt ( mode , 8 ) , {
148
+ mode , {
138
149
...defaultOptions ,
139
150
timeout : 1000
140
151
}
0 commit comments