1
votes

I've been breaking my head trying to setup a base project for angular2, sass and ng2-bootstrap, this project is based on the angular2-seed project and you can find the entire code base here: https://github.com/omargon/angular-seed-sass-ng2-bootstrap Everything gets build as expected both for dev and prod distribution. But I keep getting the following error whenever I try to run my uni and e2e tests:

START:
18 05 2016 12:49:29.095:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
18 05 2016 12:49:29.100:INFO [launcher]: Starting browser PhantomJS
18 05 2016 12:49:29.112:INFO [launcher]: Starting browser Chrome
18 05 2016 12:49:29.756:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#87aZKElcLH5MAZgxAAAA with id 21686761
18 05 2016 12:49:29.910:INFO [Chrome 50.0.2661 (Mac OS X 10.11.5)]: Connected on socket /#tFoYBsOvsGJ0dDEGAAAB with id 7030871
18 05 2016 12:49:31.062:WARN [web-server]: 404: /app/app.component.html
  NameList Service
    ✔ should return the list of names
18 05 2016 12:49:31.160:WARN [web-server]: 404: /app/app.component.html
  App component
    ✖ should build without a problem

Finished in 0.158 secs / 0.136 secs

SUMMARY:
✔ 2 tests completed
✖ 2 tests failed

FAILED TESTS:
  App component
    ✖ should build without a problem
      PhantomJS 2.1.1 (Mac OS X 0.0.0)
      Chrome 50.0.2661 (Mac OS X 10.11.5)
    Failed: Uncaught (in promise): Failed to load app/app.component.html
        at ZoneDelegate.invoke (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/zone.js/dist/zone.js:323:29)
        at Zone.run (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/zone.js/dist/zone.js:216:44)
        at /Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/zone.js/dist/zone.js:571:58
        at ZoneDelegate.invokeTask (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/zone.js/dist/zone.js:356:38)
        at Zone.runTask (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/zone.js/dist/zone.js:256:48)
        at drainMicroTaskQueue (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/zone.js/dist/zone.js:474:36)
        at F (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/systemjs/dist/system-polyfills.js:4:7484)
        at H (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/systemjs/dist/system-polyfills.js:4:7116)
        at q.when (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/systemjs/dist/system-polyfills.js:4:10790)
        at T.run (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/systemjs/dist/system-polyfills.js:4:11899)
        at t._drain (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/systemjs/dist/system-polyfills.js:4:1744)
        at drain (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/systemjs/dist/system-polyfills.js:4:1398)
        at MutationObserver.e (/Users/omar/Development/public/angular-seed-sass-ng2-bootstrap/node_modules/systemjs/dist/system-polyfills.js:4:3319)

Any help is welcome.

1

1 Answers

0
votes

Solution was to pipe build.js.test result through gulp-inline-ng2-template with the following parameters:

 {
  useRelativePaths: false,
};