diff --git a/package.json b/package.json index 1469ad2..80f9201 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "dependencies": { "angular": "^1.6.1", "angular-mocks": "^1.6.1", + "angular2-template-loader": "^0.6.2", "jasmine": "~2.2.1", - "jquery": "~2.1.3" + "jquery": "~2.1.3", + "rxjs": "^5.4.3" }, "devDependencies": { "@types/angular": "^1.6.32", diff --git a/src/my.component.ts b/src/my.component.ts index 34d3909..4e32ee6 100644 --- a/src/my.component.ts +++ b/src/my.component.ts @@ -2,7 +2,7 @@ @Component({ selector: 'my-component', - templateUrl: 'src/my.component.html' + templateUrl: './my.component.html' }) export class MyComponent { constructor() { @@ -11,4 +11,4 @@ export class MyComponent { getText() { return "test"; } -} \ No newline at end of file +} diff --git a/wallaby.js b/wallaby.js index 6c28a5e..f8f6edd 100644 --- a/wallaby.js +++ b/wallaby.js @@ -4,16 +4,18 @@ var webpackConfig = require('./webpack'); delete webpackConfig.entry; webpackConfig.resolve.extensions = ['.js','.ts']; +webpackConfig.module.rules.push({test: /\.js$/, loader: 'angular2-template-loader', exclude: /node_modules/}); +webpackConfig.module.rules.push({test: /\.html$/, loader: 'html-loader'}); + var wallabyPostprocessor = wallabyWebpack(webpackConfig); module.exports = function (wallaby) { return { files: [ - { pattern: "src/*.js", load: false }, - { pattern: "src/*.ts", load: false }, - 'node_modules/angular/angular.js', - 'node_modules/angular-mocks/angular-mocks.js', - 'node_modules/reflect-metadata/Reflect.js' + { pattern: "src/*.+(js|ts|html)", load: false }, + { pattern: "node_modules/angular/angular.js", instrument: false }, + { pattern: "node_modules/angular-mocks/angular-mocks.js", instrument: false }, + { pattern: "node_modules/reflect-metadata/Reflect.js", instrument: false }, ], tests: [ { pattern: "test/*JasmineSpec.js", load: false }, diff --git a/webpack.js b/webpack.js index de946cb..a8a5904 100644 --- a/webpack.js +++ b/webpack.js @@ -19,7 +19,7 @@ module.exports = { }, module: { rules: [ - { test: "\.html$", loader: "html-tpl" } + // { test: "\.html$", loader: "html-tpl" } ] } }