Skip to content

Commit

Permalink
testing: deprecate defineDefaults options
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 25, 2024
1 parent 9247874 commit f0b8392
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/testing/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ const defaultSharedApplication = Object.fromEntries(['CLIENT_WEBPACK_DIR'].map(k
let defaultMockFactory: (original?: any) => any;
let defaultAccumulateMockArgs: (mocks: Record<string, any>) => Record<string, any>;

export const defineDefaults = async ({
mockFactory,
accumulateMockArgs,
}: { mockFactory?: any; accumulateMockArgs?: (mock: Record<string, any>) => Record<string, any> } = {}) => {
export const defineDefaults = async (
defaults: {
/** @deprecated mock from `node:test` is used internally */
mockFactory?: any;
/** @deprecated mock from `node:test` is used internally */
accumulateMockArgs?: (mock: Record<string, any>) => Record<string, any>;
} = {},
) => {
const { mockFactory, accumulateMockArgs } = defaults;
if (mockFactory) {
defaultMockFactory = mockFactory;
} else if (!defaultMockFactory) {
Expand Down

0 comments on commit f0b8392

Please sign in to comment.