Skip to content

Commit

Permalink
fix: default config and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drochetti committed Sep 24, 2023
1 parent a9a7c80 commit b7cb450
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
5 changes: 1 addition & 4 deletions libs/client/src/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ describe('The config test suite', () => {
it('should set the config variables accordingly', () => {
const newConfig = {
host: 'some-other-host',
credentials: {
keyId: 'key-id',
keySecret: 'key-secret',
},
credentials: 'key-id:key-secret',
};
config(newConfig);
const currentConfig = getConfig();
Expand Down
1 change: 1 addition & 0 deletions libs/client/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export function config(config: Config) {
export function getConfig(): RequiredConfig {
if (!configuration) {
console.info('Using default configuration for the fal client');
return { ...DEFAULT_CONFIG } as RequiredConfig;
}
return configuration;
}
10 changes: 1 addition & 9 deletions libs/client/src/function.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import { randomUUID } from 'crypto';
import { config, getConfig } from './config';
import { getConfig } from './config';
import { buildUrl } from './function';

config({
host: 'gateway.alpha.fal.ai',
credentials: {
keyId: 'a91ff3ca-71bc-4c8c-b400-859f6cbe804d',
keySecret: '0123456789abcdfeghijklmnopqrstuv',
},
});

describe('The function test suite', () => {
it('should build the URL with a function UUIDv4', () => {
const id = randomUUID();
Expand Down

0 comments on commit b7cb450

Please sign in to comment.