Skip to content

Commit a2a58f6

Browse files
WIP
1 parent 4157c33 commit a2a58f6

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

packages/storage/.run/All Tests.run.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<env name="TS_NODE_CACHE" value="NO" />
1212
</envs>
1313
<ui>bdd</ui>
14-
<extra-mocha-options>--require ts-node/register/type-check --require index.ts</extra-mocha-options>
14+
<extra-mocha-options>--require ts-node/register/type-check --require index.node.ts</extra-mocha-options>
1515
<test-kind>PATTERN</test-kind>
1616
<test-pattern>test/{,!(browser)/**/}*.test.ts</test-pattern>
1717
<method v="2" />

packages/storage/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"test:browser:unit": "karma start --single-run --unit",
2323
"test:browser:integration": "karma start --single-run --integration",
2424
"test:browser": "karma start --single-run",
25-
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.ts --config ../../config/mocharc.node.js",
25+
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
2626
"test:debug": "karma start --browser=Chrome",
2727
"prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
2828
"api-report": "api-extractor run --local --verbose && ts-node-script ../../repo-scripts/prune-dts/prune-dts.ts --input dist/storage-public.d.ts --output dist/storage-public.d.ts",

packages/storage/src/reference.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@ export function getBytesInternal(
157157
ref.storage
158158
.makeRequestWithTokens(requestInfo, newBytesConnection)
159159
.then(request => request.getPromise())
160-
// GCS may not honor the Range header for small files
161-
.then(bytes =>maxDownloadSizeBytes!==undefined? bytes.slice(0, maxDownloadSizeBytes):bytes)
160+
.then(bytes =>
161+
maxDownloadSizeBytes !== undefined
162+
// GCS may not honor the Range header for small files
163+
? bytes.slice(0, maxDownloadSizeBytes)
164+
: bytes
165+
)
162166
);
163167
}
164168

packages/storage/test/integration/integration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('FirebaseStorage Exp', () => {
9090
);
9191
});
9292

93-
it('can get first n bytes', async () => {
93+
it.only('can get first n bytes', async () => {
9494
const reference = ref(storage, 'public/exp-bytes');
9595
await uploadBytes(reference, new Uint8Array([0, 1, 3]));
9696
const bytes = await getBytes(reference, 2);

0 commit comments

Comments
 (0)