Cypress component testing with Angular results in SassError #27344
Labels
outdated
scope: angular
Issues related to Angular support in Nx
scope: testing tools
Issues related to Cypress / Jest / Playwright / Vitest support in Nx
type: bug
Current Behavior
I work in a large org where we are building a new design system with NX so we can publish Storybook and separate libraries from the same project. This consists of one app (storybook) - and many libs that are designed to be published independently (components, styles, utilities etc).
When i run a cypress component test in a lib, the test fails because it doesn't find the sass file (imported from a shared styles lib)
nx build
,nx serve
and the storybook targets etc works fine, it's just NX's implementation of Cypress in a monorepo that does not.This occurs when a lib is completely independent (and in the libs
project.json
we must define a devServerTarget of the app build target, even though it's completely normal to have libs designed to be publishable as a separate entity)Related issue #12758 that doesn't look like there was a resolution as there wasn't a reproduction posted
If i import a component from the components lib into the top level app (even though they are totally unrelated) as an experiment, the Cypress tests works
Expected Behavior
I would expect that if we have to define a devServerTarget (even if the app is unrelated) that NX is smart enough to hoist the files where they need to go (as it does with nx build as that works because of defining
stylePreprocessorOptions
in theproject.json
and theng-package.json
)GitHub Repo
https://github.com/atomicrobokid/testmonorepo
Steps to Reproduce
Failing
Passing
angular-app
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Absolutely vital to our project we get this sorted.
NX is great for building our design system, but this is a huge blocker for our test coverage. As everything else works with this setup (serve, build, storybook, release) etc, then I would expect the Cypress implementation to follow suit
The text was updated successfully, but these errors were encountered: