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
scss-partial in a folder styles, e.g. _variables.scssstyles to stylePreprocessorOptions.includePaths in .angular-cli.json.scss-partial in any *.component.scss-file, using @import "variables"Runing ng serve works as expected, running ng test fils with
File to import not found or unreadable: variables.
The unit tests (ng test) should also use the setting and therefore be able to resolve the _variables.scss.
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.
Hi, any news please ?
I was wondering why stylePreprocessorOptions didn't work on unit tests no matter what path settings I tried...
Angular CLI 1.7.3
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.
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"
]
}
}
},
Closing as it has been answered above.
Thanks
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._
Most helpful comment
In Angular CLI 6 you just have to add the
stylePreprocessorOptionsto theoptionsblock oftest: