(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import { TodoListController } from "components/todoList.component" | |
| describe("TodoListController", () => { | |
| let controller | |
| beforeEach(() => { | |
| controller = new TodoListController() | |
| }) | |
| it("Should have a defined controller", () => { |
| export class TodoListController { | |
| constructor(){ | |
| this.todosList = [] | |
| } | |
| addTodo(todo){ | |
| this.todosList.push(todo) | |
| } | |
| toggleCheckTodo(index){ | |
| this.todosList[index].completed = !this.todosList[index].completed | |
| } |
| import { TodoListController } from "components/todoList.component" | |
| describe("TodoListController", () => { | |
| let controller | |
| beforeEach(() => { | |
| controller = new TodoListController() | |
| }) | |
| it("Should have a defined controller", () => { |
| export class TodoListController { | |
| constructor(){ | |
| this.todosList = [] | |
| } | |
| addTodo(todo){ | |
| this.todosList.push(todo) | |
| } | |
| } | |
| export const TodoListComponent = { |
| import { TodoListComponent } from "components/todoList.component" | |
| describe("TodoListComponent", () => { | |
| let controller | |
| beforeEach(() => { | |
| controller = new TodoListController() | |
| }) | |
| it("Should have a defined controller", () => { |
| export class TodoListController {} | |
| export const TodoListComponent = { | |
| controller: TodoListController | |
| } |
| import { TodoListController } from "components/todoList.component" | |
| describe("TodoListController", () => { | |
| let controller | |
| beforeEach(() => { | |
| controller = new TodoListController() | |
| }) | |
| it("Should have a defined controller", () => { |
| { | |
| "presets": [ | |
| "es2015", | |
| "stage-3" | |
| ] | |
| } |
| { | |
| "name": "angularjs-tdd-jest", | |
| "version": "0.1.0", | |
| "scripts": { | |
| "start": "webpack-dev-server", | |
| "test": "cross-env NODE_PATH=./src jest --coverage --verbose", | |
| "tdd": "cross-env NODE_PATH=./src jest --watch --verbose", | |
| "check-coverage": "npm test | http-server -so -p 9000 coverage/lcov-report" | |
| }, | |
| "dependencies": { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.