File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,26 @@ const co = require('co');
24
24
25
25
timemachine . reset ( ) ;
26
26
27
+ let cleanBucket = function * ( store ) {
28
+ let result = yield store . list ( {
29
+ 'max-keys' : 1000 ,
30
+ } ) ;
31
+ result . objects = result . objects || [ ] ;
32
+ for ( let i = 0 ; i < result . objects . length ; i ++ ) {
33
+ const obj = result . objects [ i ] ;
34
+ yield store . delete ( obj . name ) ;
35
+ }
36
+
37
+ result = yield store . listUploads ( {
38
+ 'max-uploads' : 1000 ,
39
+ } ) ;
40
+ const uploads = result . uploads || [ ] ;
41
+ for ( let i = 0 ; i < uploads . length ; i ++ ) {
42
+ const up = uploads [ i ] ;
43
+ yield store . abortMultipartUpload ( up . name , up . uploadId ) ;
44
+ }
45
+ }
46
+
27
47
describe ( 'browser' , ( ) => {
28
48
/* eslint require-yield: [0] */
29
49
before ( function * ( ) {
@@ -43,6 +63,10 @@ describe('browser', () => {
43
63
// bucket: stsConfig.bucket
44
64
// });
45
65
} ) ;
66
+ after ( function * ( ) {
67
+ this . store = oss ( ossConfig ) ;
68
+ yield cleanBucket ( this . store ) ;
69
+ } ) ;
46
70
describe ( 'endpoint' , ( ) => {
47
71
it ( 'should init with region' , ( ) => {
48
72
let store = oss ( {
You can’t perform that action at this time.
0 commit comments