Skip to content

Commit

Permalink
use object params
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Nov 18, 2023
1 parent 576d2c2 commit cab6aa0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
11 changes: 7 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,13 @@ const loadProjectConfig = async (): Promise<Config> => {
}
};

export const configure = async (
customProjectConfig?: CustomProjectConfig,
localDebugMode?: boolean,
) => {
export const configure = async ({
customProjectConfig,
localDebugMode,
}: {
customProjectConfig?: CustomProjectConfig;
localDebugMode?: boolean;
}) => {
if (customProjectConfig) {
config = parseConfig(customProjectConfig as Config);

Expand Down
8 changes: 5 additions & 3 deletions src/crawler/pageScreenshots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { generatePageShotItems } from './pageScreenshots';

beforeAll(async () => {
await configure({
...defaultTestConfig,
timeouts: {
fetchStories: 2000,
customProjectConfig: {
...defaultTestConfig,
timeouts: {
fetchStories: 2000,
},
},
});

Expand Down
8 changes: 5 additions & 3 deletions src/crawler/storybook.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ const storyBookV7Url = getStoryBookUrl(

beforeAll(async () => {
await configure({
...defaultTestConfig,
timeouts: {
fetchStories: 2000,
customProjectConfig: {
...defaultTestConfig,
timeouts: {
fetchStories: 2000,
},
},
});

Expand Down
8 changes: 5 additions & 3 deletions src/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { defaultTestConfig } from './testUtils';

beforeAll(async () => {
await configure({
...defaultTestConfig,
lostPixelProjectId: 'lorem-ipsum',
ciBuildId: '456',
customProjectConfig: {
...defaultTestConfig,
lostPixelProjectId: 'lorem-ipsum',
ciBuildId: '456',
},
});
});

Expand Down

0 comments on commit cab6aa0

Please sign in to comment.