Skip to content

Commit 244b3c5

Browse files
committed
Fix test for GCSStore#getOffset on 404 errors
1 parent bcce9b0 commit 244b3c5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/stores/GCSDataStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class GCSDataStore extends DataStore {
183183
return new Promise((resolve, reject) => {
184184
const file = this.bucket.file(file_id);
185185
file.getMetadata((error, metadata, apiResponse) => {
186-
if (error && error.message === 'Not Found') {
186+
if (error && error.code === 404) {
187187
return reject(ERRORS.FILE_NOT_FOUND);
188188
}
189189

test/Test-GCSDataStore.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ describe('GCSDataStore', () => {
196196
});
197197

198198
it('should resolve existing files with the metadata', () => {
199+
// TODO: upload this file to the bucket first
199200
return server.datastore.getOffset(FILE_ALREADY_IN_BUCKET)
200201
.should.be.fulfilledWith({
201202
size: TEST_FILE_SIZE,

0 commit comments

Comments
 (0)