diff --git a/__tests__/preprocessor.test.js b/__tests__/preprocessor.test.js index 41b833afc5..6e96e30c1a 100644 --- a/__tests__/preprocessor.test.js +++ b/__tests__/preprocessor.test.js @@ -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' + ], })` ]; diff --git a/preprocessor.js b/preprocessor.js index 04ac7a1a8f..7622e5935c 100644 --- a/preprocessor.js +++ b/preprocessor.js @@ -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) => {