Minor Changes
-
#11533
8d9003eThanks @petebacondarwin! - Add support for ctx.exportsIt is now possible to access
ctx.exportsproperties for themain(SELF) worker.- Integration tests: in the
SELFworker thectx.exportsobject now contains the expected stubs to the exported entry-points. - Unit tests: the object returned from
createExecutionContext()hasexportsproperty that exposes the exports of theSELFworker.
Due to the dynamic nature of Vitest the integration relies upon guessing what the exports of the
mainWorker are by statically analyzing the Worker source using esbuild. In cases where it is not possible to infer the exports (for example, a wildcard re-export of a virtual module) it is possible to declare these in the vitest-pool-workers config via theadditionalExportssetting. - Integration tests: in the