Skip to content

Commit

Permalink
test(storage): storage emulator handles metadata delete now
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy committed Aug 26, 2022
1 parent dc74643 commit 2516ba5
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 16 deletions.
18 changes: 8 additions & 10 deletions packages/storage/e2e/StorageReference.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ describe('storage() -> StorageReference', function () {
metadata.md5Hash.should.be.a.String();
// TODO against cloud storage cacheControl comes back null/undefined by default. Emulator has a difference
// https://github.com/firebase/firebase-tools/issues/3398#issuecomment-1159821364
should.equal(metadata.cacheControl, 'public, max-age=3600');
// should.equal(metadata.cacheControl, undefined);
should.equal(metadata.contentLanguage, null);
should.equal(metadata.customMetadata, null);
// should.equal(metadata.customMetadata, null);
});
});

Expand Down Expand Up @@ -429,14 +429,12 @@ describe('storage() -> StorageReference', function () {
metadata.bucket.should.equal(`${firebase.app().options.projectId}.appspot.com`);

// Things that we may set (or remove)
// FIXME for storage emulator values are not cleared. Works against cloud
// https://github.com/firebase/firebase-tools/issues/3398#issuecomment-1159821364
// should.equal(metadata.cacheControl, undefined); // fails on android against storage emulator
// should.equal(metadata.contentDisposition, undefined); // fails on android against storage emulator
// should.equal(metadata.contentEncoding, 'identity'); // fails on android against storage emulator
// should.equal(metadata.contentLanguage, undefined); // fails on android against storage emulator
// should.equal(metadata.contentType, undefined); // fails on android against storage emulator
// should.equal(metadata.customMetadata, undefined); // fails on android against storage emulator
should.equal(metadata.cacheControl, undefined);
should.equal(metadata.contentDisposition, undefined);
should.equal(metadata.contentEncoding, 'identity');
should.equal(metadata.contentLanguage, undefined);
should.equal(metadata.contentType, undefined);
should.equal(metadata.customMetadata, undefined);
});

it('should set update or remove customMetadata properties correctly', async function () {
Expand Down
2 changes: 1 addition & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"babel-plugin-istanbul": "^6.0.0",
"detox": "^19.9.1",
"firebase": "^9.8.3",
"firebase-tools": "11.6.0",
"firebase-tools": "11.8.0",
"jest-circus": "^28.1.1",
"jest-environment-node": "^28.1.1",
"jet": "^0.8.1",
Expand Down
62 changes: 57 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3943,6 +3943,9 @@
version "5.28.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz#982bb226b763c48fc1859a60de33fbf939d40a0f"
integrity sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA==
dependencies:
"@typescript-eslint/types" "5.28.0"
eslint-visitor-keys "^3.3.0"

"@ungap/promise-all-settled@1.1.2":
version "1.1.2"
Expand Down Expand Up @@ -4409,6 +4412,11 @@ async-limiter@~1.0.0:
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd"
integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==

async-lock@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/async-lock/-/async-lock-1.3.2.tgz#56668613f91c1c55432b4db73e65c9ced664e789"
integrity sha512-phnXdS3RP7PPcmP6NWWzWMU0sLTeyvtZCxBPpZdkYE3seGLKSQZs9FrmVO/qwypq98FUtWWUEYxziLkdGk5nnA==

async@^2.4.0, async@^2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
Expand Down Expand Up @@ -7102,15 +7110,16 @@ firebase-frameworks@^0.4.2:
semver "^7.3.7"
tslib "^2.3.1"

firebase-tools@11.6.0:
version "11.6.0"
resolved "https://registry.yarnpkg.com/firebase-tools/-/firebase-tools-11.6.0.tgz#f4d00fe570e222cf2c89d88ba7547544989989cf"
integrity sha512-uVZN2I+xsNdPnxNZ4PCSyGNKQJ7YzDZFcXD4Xpxa9ecIqbeK7/a80fQZ4PnoXmOjlDJrJIDtCFGq3UqGYUL33Q==
firebase-tools@11.8.0:
version "11.8.0"
resolved "https://registry.yarnpkg.com/firebase-tools/-/firebase-tools-11.8.0.tgz#e63c4e02d895d28821be8949c3bb7f914b858cf9"
integrity sha512-xUKG2WygVfZbM/cRCzvmzRf5m05h3UBprZl4lMMNhVSY5Dw4o77nPTJqDAsB9N6bMvphixSN8q4mu0NhtJGx/Q==
dependencies:
"@google-cloud/pubsub" "^3.0.1"
abort-controller "^3.0.0"
ajv "^6.12.6"
archiver "^5.0.0"
async-lock "1.3.2"
body-parser "^1.19.0"
chokidar "^3.0.2"
cjson "^0.3.1"
Expand All @@ -7120,7 +7129,7 @@ firebase-tools@11.6.0:
configstore "^5.0.1"
cors "^2.8.5"
cross-env "^5.1.3"
cross-spawn "^7.0.1"
cross-spawn "^7.0.3"
csv-parse "^5.0.4"
exegesis "^4.1.0"
exegesis-express "^4.0.0"
Expand All @@ -7131,6 +7140,7 @@ firebase-tools@11.6.0:
fs-extra "^10.1.0"
glob "^7.1.2"
google-auth-library "^7.11.0"
googleapis "^105.0.0"
inquirer "^8.2.0"
js-yaml "^3.13.1"
jsonwebtoken "^8.5.1"
Expand Down Expand Up @@ -7491,6 +7501,16 @@ gaxios@^5.0.0:
is-stream "^2.0.0"
node-fetch "^2.6.7"

gaxios@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-5.0.1.tgz#50fc76a2d04bc1700ed8c3ff1561e52255dfc6e0"
integrity sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw==
dependencies:
extend "^3.0.2"
https-proxy-agent "^5.0.0"
is-stream "^2.0.0"
node-fetch "^2.6.7"

gcp-metadata@^4.2.0:
version "4.3.1"
resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-4.3.1.tgz#fb205fe6a90fef2fd9c85e6ba06e5559ee1eefa9"
Expand Down Expand Up @@ -7836,6 +7856,26 @@ google-p12-pem@^3.1.3:
dependencies:
node-forge "^1.0.0"

googleapis-common@^6.0.0:
version "6.0.1"
resolved "https://registry.yarnpkg.com/googleapis-common/-/googleapis-common-6.0.1.tgz#99a9cd2a8a62b970f5c701496a227db33b9991f4"
integrity sha512-COe4g+58FoIkLUe4ljlCl6ytgSqPYIyCrT9kEp+VDL3Ca5NAOqExZ13whJUZklmSgxS3isEbTBt5c7SgD0kfMA==
dependencies:
extend "^3.0.2"
gaxios "^5.0.1"
google-auth-library "^8.0.2"
qs "^6.7.0"
url-template "^2.0.8"
uuid "^8.0.0"

googleapis@^105.0.0:
version "105.0.0"
resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-105.0.0.tgz#65ff8969cf837a08ee127ae56468ac3d96ddc9d5"
integrity sha512-wH/jU/6QpqwsjTKj4vfKZz97ne7xT7BBbKwzQEwnbsG8iH9Seyw19P+AuLJcxNNrmgblwLqfr3LORg4Okat1BQ==
dependencies:
google-auth-library "^8.0.2"
googleapis-common "^6.0.0"

got@^9.6.0:
version "9.6.0"
resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
Expand Down Expand Up @@ -12199,6 +12239,13 @@ qs@^6.6.0, qs@^6.9.4:
dependencies:
side-channel "^1.0.4"

qs@^6.7.0:
version "6.11.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
dependencies:
side-channel "^1.0.4"

qs@~6.5.2:
version "6.5.3"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
Expand Down Expand Up @@ -14491,6 +14538,11 @@ url-parse-lax@^3.0.0:
dependencies:
prepend-http "^2.0.0"

url-template@^2.0.8:
version "2.0.8"
resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21"
integrity sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==

urlgrey@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-1.0.0.tgz#72d2f904482d0b602e3c7fa599343d699bbe1017"
Expand Down

0 comments on commit 2516ba5

Please sign in to comment.