Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cleanup)!: Remove redundant callback types, move storage.ts to … #2445

Open
wants to merge 7 commits into
base: gaxios-feature
Choose a base branch
from
10 changes: 4 additions & 6 deletions conformance-test/conformanceCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import * as libraryMethods from './libraryMethods';
import {Bucket, File, HmacKey, Notification, Storage} from '../src/';
import * as uuid from 'uuid';
import * as assert from 'assert';
import {DecorateRequestOptions} from '../src/nodejs-common';
import fetch from 'node-fetch';

interface RetryCase {
Expand Down Expand Up @@ -122,19 +121,18 @@ export function executeScenario(testCase: RetryTestCase) {
notification = bucket.notification(`${TESTS_PREFIX}`);
await notification.create();

[hmacKey] = await storage.createHmacKey(
`${TESTS_PREFIX}@email.com`
);
hmacKey = await storage.createHmacKey(`${TESTS_PREFIX}@email.com`);

storage.interceptors.push({
//TODO: Interceptors
/* storage.interceptors.push({
request: requestConfig => {
requestConfig.headers = requestConfig.headers || {};
Object.assign(requestConfig.headers, {
'x-retry-test-id': creationResult.id,
});
return requestConfig as DecorateRequestOptions;
},
});
}); */
});

it(`${instructionNumber}`, async () => {
Expand Down
4 changes: 2 additions & 2 deletions conformance-test/libraryMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export async function combine(options: ConformanceTestOptions) {
}

export async function create(options: ConformanceTestOptions) {
const [bucketExists] = await options.bucket!.exists();
const bucketExists = await options.bucket!.exists();
if (bucketExists) {
await options.bucket!.deleteFiles();
await options.bucket!.delete({
Expand Down Expand Up @@ -795,7 +795,7 @@ export async function notificationGetMetadata(options: ConformanceTestOptions) {

export async function createBucket(options: ConformanceTestOptions) {
const bucket = options.storage!.bucket('test-creating-bucket');
const [exists] = await bucket.exists();
const exists = await bucket.exists();
if (exists) {
bucket.delete();
}
Expand Down
2 changes: 1 addition & 1 deletion internal-tooling/performanceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export async function performanceTestSetup(
ifGenerationMatch: 0,
},
});
if (!(await bucket.exists())[0]) {
if (!(await bucket.exists())) {
await bucket.create();
}
const transferManager = new TransferManager(bucket);
Expand Down