Skip to content

Commit

Permalink
test: avoid overriding region
Browse files Browse the repository at this point in the history
  • Loading branch information
zirkelc committed Jul 21, 2024
1 parent 2191947 commit 25024a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export type Resolveable<TResolved, TArgs extends any[] = []> =
| TResolved
| ((...args: TArgs) => TResolved);

// export type ResolvedFn<TResolved, TArgs extends any[] = []> = ((...args: TArgs) => TResolved);

export type Payload<TPayload = any> = TPayload;
export type Reference<TReference = any> = TReference;

Expand Down
6 changes: 3 additions & 3 deletions packages/store-s3/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class S3Store<TInput = unknown, TOutput = unknown>

const reference = input.reference as S3Reference;
const bucketFn = resolvableFn(this.#bucket);
const bucket = bucketFn();
const bucket = this.#bucket();

if (isS3ObjectArn(reference)) {
const { bucket: otherBucket } = parseS3ObjectArn(reference);
Expand Down Expand Up @@ -152,7 +152,7 @@ export class S3Store<TInput = unknown, TOutput = unknown>

const client = new S3Client({
...this.#config,
region,
region: region ?? this.#config.region,
});

const { bucket, key } = parseS3Reference(input.reference);
Expand Down Expand Up @@ -225,7 +225,7 @@ export class S3Store<TInput = unknown, TOutput = unknown>

const client = new S3Client({
...this.#config,
region,
region: region ?? this.#config.region,
});

try {
Expand Down
2 changes: 1 addition & 1 deletion vitest.root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "vitest/config";

// load region from config to prevent error "ConfigError: Missing region in config"
// https://github.com/aws/aws-sdk-js/pull/1391
process.env.AWS_SDK_LOAD_CONFIG = "1";
// process.env.AWS_SDK_LOAD_CONFIG = "1";

export default defineConfig({
test: {
Expand Down

0 comments on commit 25024a2

Please sign in to comment.