Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stylePreprocessorOptions not used for unit tests #8833

Closed
probert94 opened this issue Dec 11, 2017 · 6 comments
Closed

stylePreprocessorOptions not used for unit tests #8833

probert94 opened this issue Dec 11, 2017 · 6 comments
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken

Comments

@probert94
Copy link

Versions

Angular CLI: 1.6.0
Node: 8.5.0
OS: win32 x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.0.0
@angular/cli: 1.6.0
@angular/flex-layout: 2.0.0-beta.10
@angular/material: 5.0.0
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.5.3
webpack: 3.10.0

Repro steps

  • Create a scss-partial in a folder styles, e.g. _variables.scss
  • Add styles to stylePreprocessorOptions.includePaths in .angular-cli.json.
  • Use this scss-partial in any *.component.scss-file, using @import "variables"

Observed behavior

Runing ng serve works as expected, running ng test fils with
File to import not found or unreadable: variables.

Desired behavior

The unit tests (ng test) should also use the setting and therefore be able to resolve the _variables.scss.

Mention any other details that might be useful (optional)

This has already been reported in #4200, but this issue has been closed in favor of #3605.
That issue in turn, has been closed in february, however it does not seem to be fixed or is broken again.

@Brocco Brocco added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken labels Dec 11, 2017
@choucry13
Copy link

Hi, any news please ?

@dereklin
Copy link

dereklin commented Mar 29, 2018

I was wondering why stylePreprocessorOptions didn't work on unit tests no matter what path settings I tried...

Angular CLI 1.7.3

@braheem
Copy link

braheem commented May 2, 2018

Bumping this as I have experienced this issue as well.

We're basically unable to use the includePaths feature at all if it does not work with ng test.

@magnattic
Copy link

In Angular CLI 6 you just have to add the stylePreprocessorOptions to the options block of test:


        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            ....
            "stylePreprocessorOptions": {
              "includePaths": [
                "src/styles",
                "libs/ui/styles",
                "libs/ui/styles/abstracts"
              ]
            }
          }
        },

@alan-agius4
Copy link
Collaborator

Closing as it has been answered above.

Thanks

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken
Projects
None yet
Development

No branches or pull requests

8 participants