Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Nov 15, 2024
1 parent 0d8a9be commit a02bf59
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions packages/wxt/src/core/utils/testing/fake-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ import {
UserManifest,
Wxt,
SidepanelEntrypoint,
WxtHooks,
} from '../../../types';
import { mock } from 'vitest-mock-extended';
import { vi } from 'vitest';
import { setWxtForTesting } from '../../../core/wxt';
import { Hookable } from 'hookable';

faker.seed(import.meta.test.SEED);

Expand Down Expand Up @@ -312,19 +310,16 @@ export const fakeResolvedConfig = fakeObjectCreator<ResolvedConfig>(() => {
};
});

export const fakeWxt = fakeObjectCreator<Wxt>(() => {
const hooks = mock<Hookable<WxtHooks>>();
return {
config: fakeResolvedConfig(),
hook: hooks.hook,
hooks,
logger: mock(),
reloadConfig: vi.fn(),
pm: mock(),
server: faker.helpers.arrayElement([undefined, fakeWxtDevServer()]),
builder: mock(),
};
});
export const fakeWxt = fakeObjectCreator<Wxt>(() => ({
config: fakeResolvedConfig(),
hook: vi.fn(),
hooks: mock(),
logger: mock(),
reloadConfig: vi.fn(),
pm: mock(),
server: faker.helpers.arrayElement([undefined, fakeWxtDevServer()]),
builder: mock(),
}));

export const fakeWxtDevServer = fakeObjectCreator<WxtDevServer>(() => ({
currentOutput: fakeBuildOutput(),
Expand Down

0 comments on commit a02bf59

Please # to comment.