From d80f310eb4b3b3a9c18ff80a5eff23f4dd85d328 Mon Sep 17 00:00:00 2001 From: Tuyen Nguyen Date: Wed, 13 Mar 2024 10:53:37 +0700 Subject: [PATCH] fix: change vitest config for the using keyword --- packages/beacon-node/vitest.e2e.config.ts | 4 ++++ packages/beacon-node/vitest.spec.config.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/beacon-node/vitest.e2e.config.ts b/packages/beacon-node/vitest.e2e.config.ts index b9f913705ef2..18034e3eedd1 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 f4f301c7985f..5a34374d2374 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"], },