Skip to content

Commit

Permalink
fix: update mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
doc-han committed Dec 1, 2024
1 parent 6293248 commit cc070a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/cli/test/docgen/handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const loadJSON = async (path: string) => {

// Mock doc gen function
const mockGen: DocGenFn = async () => ({
namespaces: [{ type: 'namespace', name: 'smth' }],
name: 'test',
version: '1.0.0',
functions: [
Expand All @@ -41,6 +42,7 @@ const mockGen: DocGenFn = async () => ({
magic: false,
parameters: [],
examples: [],
type: 'function',
},
],
});
Expand Down
6 changes: 4 additions & 2 deletions packages/ws-worker/src/mock/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ export class MockSocket {
private allChannels: ChannelMap;
private callbacks: Record<string, EventHandler>;

endpoint: string;
constructor(
private _endpoint: string = '',
private channels: ChannelMap = {},
endpoint: string = '',
channels: ChannelMap = {},
private _connect: () => Promise<void> = async () => {}
) {
this.allChannels = channels;
this.callbacks = {};
this.endpoint = endpoint;
}

onOpen(callback: EventHandler): void {
Expand Down

0 comments on commit cc070a6

Please sign in to comment.