mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-05 23:54:25 +00:00
fix(workflow): fix test file lint and typecheck errors
This commit is contained in:
@@ -14,7 +14,7 @@ describe('temporalWorkflow plugin', () => {
|
|||||||
it('should register onLoad and configure webpackConfigHook with @temporalio/workflow alias', async () => {
|
it('should register onLoad and configure webpackConfigHook with @temporalio/workflow alias', async () => {
|
||||||
const plugin = temporalWorkflow()
|
const plugin = temporalWorkflow()
|
||||||
|
|
||||||
let onLoadCallback: Function | null = null
|
let onLoadCallback: ((...args: unknown[]) => unknown) | null = null
|
||||||
|
|
||||||
const mockBuild = {
|
const mockBuild = {
|
||||||
onResolve: vi.fn(),
|
onResolve: vi.fn(),
|
||||||
@@ -35,8 +35,10 @@ describe('temporalWorkflow plugin', () => {
|
|||||||
// Verify bundleWorkflowCode was called
|
// Verify bundleWorkflowCode was called
|
||||||
expect(worker.bundleWorkflowCode).toHaveBeenCalled()
|
expect(worker.bundleWorkflowCode).toHaveBeenCalled()
|
||||||
|
|
||||||
// Inspect the webpackConfigHook that was passed to bundleWorkflowCode
|
// Webpack's configuration type is complex and varies across versions.
|
||||||
const callArgs = vi.mocked(worker.bundleWorkflowCode).mock.calls[0][0]
|
// We cast it to any here to allow indexing the config aliases dynamically.
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const callArgs = vi.mocked(worker.bundleWorkflowCode).mock.calls[0][0] as any
|
||||||
expect(callArgs.webpackConfigHook).toBeDefined()
|
expect(callArgs.webpackConfigHook).toBeDefined()
|
||||||
|
|
||||||
// Invoke the hook with a dummy config
|
// Invoke the hook with a dummy config
|
||||||
|
|||||||
Reference in New Issue
Block a user