karma-runner / karma-runner/karma

Not able to load, on karma testing, a scss file, imported in a component's scss file, in an angular js app

Open
#3,089 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Expected behaviour
Load the global scss files

### Actual behaviour
Not able to import global scss files which are imported in component's individual scss file; I have even used karma-scss-preprocessor

### Environment Details

- Karma version (output of `karma --version`): 2.0.4
- Relevant part of your `karma.config.js` file

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-scss-preprocessor')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
files: [
{pattern: 'app/**/**/**/*.scss', included: false},
{pattern: 'app/**/**/*.scss', included: false},
'variables.scss'
],
preprocessors: {
'variables.scss': ['scss']
}
});
};

### Steps to reproduce the behaviour

1.Please find rest of the details on this link -> https://stackoverflow.com/questions/51518004/not-able-to-load-on-karma-testing-a-scss-file-imported-in-a-components-scss

Contributor guide

Open the contributing guide

Research direction

Start with the karma.config.js configuration and the linked Stack Overflow reproduction details; run the Karma setup described there to isolate how component SCSS imports are handled. Done means the referenced global SCSS files load during Karma tests without the reported import failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript, scss
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.