From 8d2c15da51a0945d9cace17f54671e9a4a99205a Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Fri, 8 Mar 2024 17:00:13 +0100 Subject: [PATCH] test(core): Fix circular dependency test failure --- ...ult-product-variant-price-calculation-strategy.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/src/config/catalog/default-product-variant-price-calculation-strategy.spec.ts b/packages/core/src/config/catalog/default-product-variant-price-calculation-strategy.spec.ts index 3444a5164f..3c71ed7d85 100644 --- a/packages/core/src/config/catalog/default-product-variant-price-calculation-strategy.spec.ts +++ b/packages/core/src/config/catalog/default-product-variant-price-calculation-strategy.spec.ts @@ -15,10 +15,8 @@ import { } from '../../testing/order-test-utils'; import { ensureConfigLoaded } from '../config-helpers'; -import { DefaultProductVariantPriceCalculationStrategy } from './default-product-variant-price-calculation-strategy'; - describe('DefaultProductVariantPriceCalculationStrategy', () => { - let strategy: DefaultProductVariantPriceCalculationStrategy; + let strategy: import('./default-product-variant-price-calculation-strategy').DefaultProductVariantPriceCalculationStrategy; const inputPrice = 6543; const productVariant = new ProductVariant({}); @@ -27,6 +25,10 @@ describe('DefaultProductVariantPriceCalculationStrategy', () => { }); beforeEach(async () => { + // Dynamic import to avoid vitest circular dependency issue + const { DefaultProductVariantPriceCalculationStrategy } = await import( + './default-product-variant-price-calculation-strategy.js' + ); strategy = new DefaultProductVariantPriceCalculationStrategy(); const mockInjector = { get: () => {