@@ -77,15 +77,15 @@ describe('stack/pipeline/api', () => {
77
77
test ( `it should register ${ method } ${ endpoint } ` , ( ) => {
78
78
pipelineApi . plugins . assert . apiCallRegistered ( method , endpoint ) ;
79
79
} ) ;
80
- test ( 'it should throw error when guarding bad files' , ( ) => {
80
+ test ( 'it should throw error when guarding bad files' , async ( ) => {
81
81
const error = "testing error" ;
82
82
pipelineApi . apiGuardBadFile = sinon . stub ( ) . throws ( new Error ( error ) ) ;
83
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
83
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
84
84
assert ( resp . send . calledWith ( { error } ) ) ;
85
85
} ) ;
86
- test ( 'it should return a file' , ( ) => {
86
+ test ( 'it should return a file' , async ( ) => {
87
87
pipelineApi . apiGuardBadFile = sinon . stub ( ) . returns ( ) ;
88
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
88
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
89
89
assert ( readFileSync . calledWith ( filepath , 'utf8' ) ) ;
90
90
assert ( resp . send . calledWith ( { name : "file" , content : "content" , path : filepath } ) ) ;
91
91
} ) ;
@@ -107,15 +107,15 @@ describe('stack/pipeline/api', () => {
107
107
test ( `it should register ${ method } ${ endpoint } ` , ( ) => {
108
108
pipelineApi . plugins . assert . apiCallRegistered ( method , endpoint ) ;
109
109
} ) ;
110
- test ( 'it should throw error when guarding bad files' , ( ) => {
110
+ test ( 'it should throw error when guarding bad files' , async ( ) => {
111
111
const error = "testing error" ;
112
112
pipelineApi . apiGuardBadFile = sinon . stub ( ) . throws ( new Error ( error ) ) ;
113
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
113
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
114
114
assert ( resp . send . calledWith ( { error } ) ) ;
115
115
} ) ;
116
- test ( 'it should create a folder' , ( ) => {
116
+ test ( 'it should create a folder' , async ( ) => {
117
117
pipelineApi . apiGuardBadFile = sinon . stub ( ) . returns ( ) ;
118
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
118
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
119
119
assert ( mkdirpSync . calledWith ( filepath ) ) ;
120
120
assert ( resp . send . calledWith ( { name : "folder" , path : filepath } ) ) ;
121
121
} ) ;
@@ -137,15 +137,15 @@ describe('stack/pipeline/api', () => {
137
137
test ( `it should register ${ method } ${ endpoint } ` , ( ) => {
138
138
pipelineApi . plugins . assert . apiCallRegistered ( method , endpoint ) ;
139
139
} ) ;
140
- test ( 'it should throw error when guarding bad files' , ( ) => {
140
+ test ( 'it should throw error when guarding bad files' , async ( ) => {
141
141
const error = "testing error" ;
142
142
pipelineApi . apiGuardBadFile = sinon . stub ( ) . throws ( new Error ( error ) ) ;
143
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
143
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
144
144
assert ( resp . send . calledWith ( { error } ) ) ;
145
145
} ) ;
146
- test ( 'it should write a file to the filesystem' , ( ) => {
146
+ test ( 'it should write a file to the filesystem' , async ( ) => {
147
147
pipelineApi . apiGuardBadFile = sinon . stub ( ) . returns ( ) ;
148
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
148
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
149
149
assert ( writeFileSync . calledWith ( req . path , req . content , { encoding : 'utf8' } ) ) ;
150
150
assert ( resp . send . calledWith ( { name : "file" , ...req } ) ) ;
151
151
} ) ;
@@ -167,15 +167,15 @@ describe('stack/pipeline/api', () => {
167
167
test ( `it should register ${ method } ${ endpoint } ` , ( ) => {
168
168
pipelineApi . plugins . assert . apiCallRegistered ( method , endpoint ) ;
169
169
} ) ;
170
- test ( 'it should throw error when guarding bad files' , ( ) => {
170
+ test ( 'it should throw error when guarding bad files' , async ( ) => {
171
171
const error = "testing error" ;
172
172
pipelineApi . apiGuardBadFile = sinon . stub ( ) . throws ( new Error ( error ) ) ;
173
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
173
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
174
174
assert ( resp . send . calledWith ( { error } ) ) ;
175
175
} ) ;
176
- test ( 'it should delete a file from the filesystem' , ( ) => {
176
+ test ( 'it should delete a file from the filesystem' , async ( ) => {
177
177
pipelineApi . apiGuardBadFile = sinon . stub ( ) . returns ( ) ;
178
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
178
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
179
179
assert ( removeSync . calledWith ( req . path ) ) ;
180
180
assert ( resp . send . called ) ;
181
181
} ) ;
@@ -211,8 +211,8 @@ describe('stack/pipeline/api', () => {
211
211
test ( `it should register ${ method } ${ endpoint } ` , ( ) => {
212
212
pipelineApi . plugins . assert . apiCallRegistered ( method , endpoint ) ;
213
213
} ) ;
214
- test ( 'it should return a tree of file objects for the dapp' , ( ) => {
215
- const resp = pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
214
+ test ( 'it should return a tree of file objects for the dapp' , async ( ) => {
215
+ const resp = await pipelineApi . plugins . mock . apiCall ( method , endpoint , req ) ;
216
216
const expectedValue = [
217
217
{
218
218
isRoot : true ,
0 commit comments