Skip to content

Commit d710a95

Browse files
committed
Use alternative method to clear bucket.
1 parent 784b8bc commit d710a95

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

packages/rules-unit-testing/src/impl/test_environment.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,13 @@ export class RulesTestEnvironmentImpl implements RulesTestEnvironment {
123123

124124
clearStorage(): Promise<void> {
125125
this.checkNotDestroyed();
126-
return this.withSecurityRulesDisabled(context => {
127-
return context.storage().ref().delete();
126+
return this.withSecurityRulesDisabled(async context => {
127+
const { items } = await context.storage().ref().listAll();
128+
await Promise.all(
129+
items.map(item => {
130+
return item.delete();
131+
})
132+
);
128133
});
129134
}
130135

yarn.lock

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5675,13 +5675,6 @@ concat-stream@^2.0.0:
56755675
readable-stream "^3.0.2"
56765676
typedarray "^0.0.6"
56775677

5678-
concat-with-sourcemaps@^1.0.0:
5679-
version "1.1.0"
5680-
resolved "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e"
5681-
integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==
5682-
dependencies:
5683-
source-map "^0.6.1"
5684-
56855678
config-chain@^1.1.12:
56865679
version "1.1.13"
56875680
resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4"
@@ -8742,15 +8735,6 @@ gulp-cli@^2.2.0:
87428735
v8flags "^3.2.0"
87438736
yargs "^7.1.0"
87448737

8745-
8746-
version "2.6.1"
8747-
resolved "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz#633d16c95d88504628ad02665663cee5a4793353"
8748-
integrity sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=
8749-
dependencies:
8750-
concat-with-sourcemaps "^1.0.0"
8751-
through2 "^2.0.0"
8752-
vinyl "^2.0.0"
8753-
87548738
87558739
version "7.0.0"
87568740
resolved "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz#e0712f3e57b5d647f802a1880255cafb54abf158"

0 commit comments

Comments
 (0)