Skip to content

Commit

Permalink
fix: transformer breaking on spaces before colon (#165)
Browse files Browse the repository at this point in the history
Fixes #164
  • Loading branch information
Nierrrrrrr authored and thymikee committed Jun 26, 2018
1 parent 7b91516 commit bd5b569
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions __tests__/preprocessor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ const sources = [
'../media-box.component.scss',
'./media-box-h0.component.scss'
],
})`,
`@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'
],
})`
];

Expand Down
4 changes: 2 additions & 2 deletions preprocessor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const process = require('ts-jest/preprocessor.js').process;
const TEMPLATE_URL_REGEX = /templateUrl:\s*('|")(\.\/){0,}(.*)('|")/g;
const STYLE_URLS_REGEX = /styleUrls:\s*\[[^\]]*\]/g;
const TEMPLATE_URL_REGEX = /templateUrl\s*:\s*('|")(\.\/){0,}(.*)('|")/g;
const STYLE_URLS_REGEX = /styleUrls\s*:\s*\[[^\]]*\]/g;
const ESCAPE_TEMPLATE_REGEX = /(\${|\`)/g;

module.exports.process = (src, path, config, transformOptions) => {
Expand Down

0 comments on commit bd5b569

Please sign in to comment.