javascript - Angular2 with Karma: web-server 404 -
i've managed configure karma , played dummy test success. however, things complicated try implement real test:
about configuration: test files (spec) , ts
files in app
folder. on other hand, js
files , js.map
files in dist
folder.
here karma conf file:
... files: [ // system.js module loading 'node_modules/systemjs/dist/system.src.js', // polyfills 'node_modules/core-js/client/shim.js', 'node_modules/reflect-metadata/reflect.js', // zone.js 'node_modules/zone.js/dist/zone.js', 'node_modules/zone.js/dist/long-stack-trace-zone.js', 'node_modules/zone.js/dist/proxy.js', 'node_modules/zone.js/dist/sync-test.js', 'node_modules/zone.js/dist/jasmine-patch.js', 'node_modules/zone.js/dist/async-test.js', 'node_modules/zone.js/dist/fake-async-test.js', // rxjs { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, { pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false }, // paths loaded via module imports: // angular { pattern: 'node_modules/@angular/**/*.js', included: false, watched: false }, { pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false }, { pattern: 'systemjs.config.js', included: false, watched: false }, 'karma-test-shim.js', // transpiled application & spec code paths loaded via module imports { pattern: 'dist/**/*.js', included: false, watched: true }, // asset (html & css) paths loaded via angular's component compiler // (these paths need rewritten, see proxies section) { pattern: 'app/**/*.html', included: false, watched: true }, { pattern: 'app/**/*.css', included: false, watched: true }, // paths debugging source maps in dev tools { pattern: 'app/**/*.ts', included: false, watched: false }, { pattern: 'dist/**/*.js.map', included: false, watched: false }, ], // proxied base paths loading assets proxies: { // required component assets fetched angular's compiler "/app/": "base/app" }, exclude: [], preprocessors: {},
it gives me following error:
start: ... 05 11 2016 21:42:53.211:warn [web-server]: 404: /base/dist/js/app/account/account.component 05 11 2016 21:42:53.217:warn [web-server]: 404: /base/dist/js/app/account/account.service chrome 54.0.2840 (mac os x 10.12.1) error { "originalerr": {} } finished in 0.827 secs / 0 secs summary: ✔ 0 tests completed npm err! test failed. see above more details.
i'm using systemjs
. after research, looks wrong conf (and way i'm providing files karma). i've tried match angular2-starter repositories can't find project configuration similar mine.
other configuration files available on github (branch feature/tests):
thanks help!
Comments
Post a Comment