mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
test: fix type errors (#11325)
* test: fix type errors * chore: use MockedFunction --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/consistent-type-imports */
|
||||
// @ts-nocheck
|
||||
import { beforeEach, test, vi, expect } from 'vitest';
|
||||
import { test, vi, expect } from 'vitest';
|
||||
import {
|
||||
managerToFetchingStrategyOptions,
|
||||
WorkerContextFetchingStrategy,
|
||||
@@ -9,17 +7,20 @@ import {
|
||||
WorkerReceivePayloadOp,
|
||||
type WorkerReceivePayload,
|
||||
type WorkerSendPayload,
|
||||
type SessionInfo,
|
||||
} from '../../src/index.js';
|
||||
import { mockGatewayInformation } from '../gateway.mock.js';
|
||||
|
||||
const session = {
|
||||
const session: SessionInfo = {
|
||||
shardId: 0,
|
||||
shardCount: 1,
|
||||
sequence: 123,
|
||||
sessionId: 'abc',
|
||||
resumeURL: 'wss://resume.url/',
|
||||
};
|
||||
|
||||
vi.mock('node:worker_threads', async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
const { EventEmitter }: typeof import('node:events') = await vi.importActual('node:events');
|
||||
class MockParentPort extends EventEmitter {
|
||||
public postMessage(message: WorkerReceivePayload) {
|
||||
|
||||
Reference in New Issue
Block a user