diff --git a/packages/beacon-node/vitest.e2e.config.ts b/packages/beacon-node/vitest.e2e.config.ts index b9f913705ef..18034e3eedd 100644 --- a/packages/beacon-node/vitest.e2e.config.ts +++ b/packages/beacon-node/vitest.e2e.config.ts @@ -1,9 +1,13 @@ import {defineConfig, mergeConfig} from "vitest/config"; +import {buildTargetPlugin} from "../../scripts/vitest/plugins/buildTargetPlugin"; import vitestConfig from "../../vitest.base.e2e.config"; export default mergeConfig( vitestConfig, defineConfig({ + // We need to change the build target to test code which is based on `using` keyword + // Note this target is not fully supported for the browsers + plugins: [buildTargetPlugin("es2022")], test: { globalSetup: ["./test/globalSetup.ts"], }, diff --git a/packages/beacon-node/vitest.spec.config.ts b/packages/beacon-node/vitest.spec.config.ts index f4f301c7985..5a34374d237 100644 --- a/packages/beacon-node/vitest.spec.config.ts +++ b/packages/beacon-node/vitest.spec.config.ts @@ -1,9 +1,13 @@ import {defineConfig, mergeConfig} from "vitest/config"; +import {buildTargetPlugin} from "../../scripts/vitest/plugins/buildTargetPlugin"; import vitestConfig from "../../vitest.base.spec.config"; export default mergeConfig( vitestConfig, defineConfig({ + // We need to change the build target to test code which is based on `using` keyword + // Note this target is not fully supported for the browsers + plugins: [buildTargetPlugin("es2022")], test: { globalSetup: ["./test/globalSetup.ts"], },