Writing the most basic Unit test in Angular 2?
After opening the debug page you could see that angular was telling you that it was missing the reflect-metadata
package. So I added a manual import statement, for it in app/todo/todo.js
which solved the issue:
import Reflect from 'reflect-metadata'import { ComponentAnnotation as Component, ViewAnnotation as View } from 'angular2/angular2';import List from './list/list';
My output is now:
node_modules/.bin/karma start --single-runINFO [karma]: Karma v0.12.36 server started at http://localhost:9876/INFO [launcher]: Starting browser ChromeWARN [web-server]: 404: /favicon.icoINFO [Chrome 43.0.2357 (Mac OS X 10.10.3)]: Connected on socket cGnqva8p5bf-j7L2EVzI with id 94803307Chrome 43.0.2357 (Mac OS X 10.10.3): Executed 7 of 7 SUCCESS (0.005 secs / 0.004 secs)