-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Labels
bugSomething that isn't workingSomething that isn't workingvitestRelating to the Workers Vitest integrationRelating to the Workers Vitest integration
Description
Which Cloudflare product(s) does this pertain to?
Workers Vitest Integration
What versions are you using?
@cloudflare/vitest-pool-workers@0.7.6
What operating system and version are you using?
Linux Ubuntu 22.04
Please provide a link to a minimal reproduction
No response
Describe the Bug
Using workspace in vitest.config.ts reports type error with defineWorkersConfig
No overload matches this call.
Overload 1 of 3, '(config: WorkersUserConfigExport): WorkersUserConfigExport', gave the following error.
Object literal may only specify known properties, and 'workers' does not exist in type '{ threads?: Pick<ThreadsOptions & WorkerContextOptions, "isolate" | "singleThread"> | undefined; vmThreads?: Pick<ThreadsOptions & VmOptions, "singleThread"> | undefined; forks?: Pick<...> | undefined; }'.
Overload 2 of 3, '(config: Promise<WorkersUserConfigExport>): Promise<WorkersUserConfigExport>', gave the following error.
Object literal may only specify known properties, and 'plugins' does not exist in type 'Promise<WorkersUserConfigExport>'.
Overload 3 of 3, '(config: ConfigFn<WorkersUserConfigExport>): ConfigFn<WorkersUserConfigExport>', gave the following error.
Object literal may only specify known properties, and 'plugins' does not exist in type 'ConfigFn<WorkersUserConfigExport>'.ts(2769)
The config file:
export default defineWorkersConfig({
plugins: [tsconfigPaths(), react()],
test: {
coverage: {
provider: 'istanbul'
},
typecheck: {
enabled: true,
tsconfig: 'tsconfig.test.json'
},
workspace: [
{
extends: true,
test: {
include: ['tests/*.test.ts', 'tests/**/*.test.ts'],
poolOptions: {
workers: {
wrangler: { configPath: './wrangler.toml' }
}
}
}
}
]
}
})Looks like @cloudflare/vitest-pool-workers does not provide overload of workspace field, only updates test
export type WorkersUserConfig<T extends ViteUserConfig> = T & {
test?: {
pool?: "@cloudflare/vitest-pool-workers";
poolMatchGlobs?: never;
poolOptions?: {
workers?: WorkersPoolOptions | ((ctx: WorkerPoolOptionsContext) => Awaitable<WorkersPoolOptions>);
};
};
};
Please provide any relevant error logs
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that isn't workingSomething that isn't workingvitestRelating to the Workers Vitest integrationRelating to the Workers Vitest integration
Type
Projects
Status
Done