From 5e6b316a090a92144451bdf571a198b51807f3d9 Mon Sep 17 00:00:00 2001 From: xfsnowind Date: Wed, 24 Apr 2024 02:26:46 +0800 Subject: [PATCH] try to solve the test in action --- dist/devServer.d.ts | 4 ++-- src/devServer.ts | 3 ++- test/makeDefaultRspackConfig.spec.ts | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/devServer.d.ts b/dist/devServer.d.ts index 3a523cf..5de72e4 100644 --- a/dist/devServer.d.ts +++ b/dist/devServer.d.ts @@ -1,6 +1,6 @@ /// -/// /// +import type { EventEmitter } from 'events'; import type { RspackDevServer } from '@rspack/dev-server'; import type { Configuration } from '@rspack/core'; import { SourceRelativeRspackResult } from './helpers/sourceRelativeRspackModules'; @@ -19,7 +19,7 @@ export type ConfigHandler = Partial | (() => Partial void; rspackConfig?: ConfigHandler; } & FrameworkConfig; diff --git a/src/devServer.ts b/src/devServer.ts index 6eccace..5219dfd 100644 --- a/src/devServer.ts +++ b/src/devServer.ts @@ -1,5 +1,6 @@ /// import debugLib from 'debug' +import type { EventEmitter } from 'events' import type { RspackDevServer } from '@rspack/dev-server' import type { Compiler, Configuration } from '@rspack/core' @@ -34,7 +35,7 @@ export type ConfigHandler = export type DevServerConfig = { specs: Cypress.Spec[] cypressConfig: Cypress.PluginConfigOptions - devServerEvents: NodeJS.EventEmitter + devServerEvents: EventEmitter onConfigNotFound?: (devServer: 'rspack', cwd: string, lookedIn: string[]) => void rspackConfig?: ConfigHandler // Derived from the user's rspack config } & FrameworkConfig diff --git a/test/makeDefaultRspackConfig.spec.ts b/test/makeDefaultRspackConfig.spec.ts index 5427603..b343cf5 100644 --- a/test/makeDefaultRspackConfig.spec.ts +++ b/test/makeDefaultRspackConfig.spec.ts @@ -1,4 +1,3 @@ -import path from 'path' import { describe, expect } from '@jest/globals' import EventEmitter from 'events' import { CreateFinalRspackConfig } from '../src/createRspackDevServer'