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

Possibility to add global styles in karma tests #6769

Closed
andreasrueedlinger opened this issue Jun 22, 2017 · 5 comments
Closed

Possibility to add global styles in karma tests #6769

andreasrueedlinger opened this issue Jun 22, 2017 · 5 comments

Comments

@andreasrueedlinger
Copy link

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ x] feature request

Versions.

@angular/cli: 1.1.2
node: 6.9.1
os: darwin x64
@angular/animations: 4.2.4
@angular/common: 4.2.4
@angular/compiler: 4.2.4
@angular/core: 4.2.4
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.2.4
@angular/http: 4.2.4
@angular/material: 2.0.0-beta.6
@angular/platform-browser: 4.2.4
@angular/platform-browser-dynamic: 4.2.4
@angular/router: 4.2.4
@angular/cli: 1.1.2
@angular/compiler-cli: 4.2.4

Repro steps.

For a normal build all the styles from app.styles are preprocessed and included in the styles bundle. How can this bundle be generated and included also in tests (karma)?
Motivation to use styles in test: angular material requires a theme setup to work correctly/not outputting tons of warnings.

@filipesilva filipesilva self-assigned this Jun 26, 2017
@filipesilva filipesilva added effort2: medium (days) P5 The team acknowledges the request but does not plan to address it, it remains open for discussion feature Issue that requests a new feature labels Jun 26, 2017
@filipesilva
Copy link
Contributor

I understand the motivation for this feature, but it might be harder than it sounds like due to the way builds are done for tests. I'll look into it if I have the time.

@andreasrueedlinger
Copy link
Author

any update on this?

@dhilt
Copy link

dhilt commented Feb 10, 2018

Maybe I missed something, but the following works in my case.

karma.conf.js

module.exports = function (config) {
  config.set({
    ...
    files: [
      './tests/misc/styles.css'
    ],
    ...
  });
};

Also, it could be a path similar to './node_modules/.../bootstrap.css'

@filipesilva filipesilva removed effort2: medium (days) P5 The team acknowledges the request but does not plan to address it, it remains open for discussion feature Issue that requests a new feature labels Feb 14, 2018
@alan-agius4
Copy link
Collaborator

Duplicate of #11072 and solved by #12371

@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
None yet
Projects
None yet
Development

No branches or pull requests

4 participants