Tests fail when components use @/ path alias imports instead of module-specific imports (e.g., @components/Link).
Steps to reproduce:
- Open any test, for instance
Alert.test.tsx.
- Open any component imported in this test's execution path. For example,
AlertLink is imported via packages/ui/src/components/alert/index.ts, which is then imported in Alert.test.tsx.
- Change the import pattern in the component from a module-specific import like
'@components/Link' to a root alias import like '@/components'.
The test will fail with the error shown in the screenshot. This appears to happen because @/components pulls in dependencies from the yaml-editor package, expanding the test's execution context beyond what's expected or properly mocked in the test environment.
Additional context:
This suggests our test environment isn't properly resolving or isolating @/ path aliases, causing unintended dependencies to be included in the test context.
Possible solution:
Either update our test configuration to properly handle @/ path aliases or continue using module-specific imports like @components/Link in components that may be subject to testing.
Tests fail when components use
@/path alias imports instead of module-specific imports (e.g.,@components/Link).Steps to reproduce:
Alert.test.tsx.AlertLinkis imported viapackages/ui/src/components/alert/index.ts, which is then imported inAlert.test.tsx.'@components/Link'to a root alias import like'@/components'.The test will fail with the error shown in the screenshot. This appears to happen because
@/componentspulls in dependencies from the yaml-editor package, expanding the test's execution context beyond what's expected or properly mocked in the test environment.Additional context:
This suggests our test environment isn't properly resolving or isolating
@/path aliases, causing unintended dependencies to be included in the test context.Possible solution:
Either update our test configuration to properly handle
@/path aliases or continue using module-specific imports like@components/Linkin components that may be subject to testing.