Skip to content

Using external css #76

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

Closed
hewIngram opened this issue Mar 29, 2018 · 4 comments
Closed

Using external css #76

hewIngram opened this issue Mar 29, 2018 · 4 comments

Comments

@hewIngram
Copy link
Contributor

Hello,

I'm looking at adding unit test coverage to my vue app but I'm having trouble fetching my css. I'm currently using external css in my components:

<style module scoped src='./Example.css' />

Which isn't working, I spotted @danielbastos11 's PR adding support for css modules and was wondering if vue-jest can deal with external css yet? If not I'm happy to extend the work in #50 to allow external css files and open a PR for it.

Thanks

@eddyerburgh
Copy link
Member

We don't support external CSS. A PR would be very welcome!

@rmartins90
Copy link

@lancetharper
Copy link

lancetharper commented May 7, 2018

I think I've run into a similar (or might be the same) issue.

<style module>
@import "some/file.css"
</style>

wrapper.vm.$style = {}.

If I change it to:

<style module>
@import "some/file.css"

.test {
  color: purple;
}
</style>

wrapper.vm.$style = { test: 'test' }

Does this look to be the same issue?

Edit:
I should point out that I'm using postcss/postcss-import and not sass/scss

Edit2:
I think my problem is specific to lack of postcss support. I've opened #91 to track there instead

@hewIngram
Copy link
Contributor Author

Just opened a PR that reads the src attribute of a style tag so that vue-jest can deal with external css.

#158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants