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

Spaces before colon in styleUrls or templateUrl seems to break tests. #164

Closed
Nierrrrrrr opened this issue Jun 26, 2018 · 0 comments
Closed

Comments

@Nierrrrrrr
Copy link
Contributor

I have a component like this (modified from preprocessor.test.js):

@Component({
  selector   : 'xc-media-box-h0',
  templateUrl: 'media-box-h0.component.html',
  styleUrls  : [
    '../../../box.component.scss',
    '../../box.component.scss',
    '../media-box.component.scss',
    './media-box-h0.component.scss'
  ],
})

My IDE will add spaces before colon to make them align.
When I run the test, it shows:

SyntaxError: The string did not match the expected pattern.

Remove the spaces before colon will fix this issue.

I think the issue is like #136. The regex in preprocessor doesn't recognize this type of component declaration.

I created a PR for fixing this, change the regex to templateUrl\s*:\s*('|")(\.\/){0,}(.*)('|") and styleUrls\s*:\s*\[[^\]]*\].

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

No branches or pull requests

1 participant