This repository is sample code for Angular 4 (Angular 2) SPA.
Use the Visual Studio Code to development.
Jasmine 框架 + Karma 測試執行工具是 Angular 普遍使用的單元測試組合,也是官方推薦的方法。
而 Webpack 也算 Angular 打包程式碼的主流工具,為了讓開發、測試及正式環境都用一樣的方式打包程式碼;
所以本篇 Angular 4 (Angular 2) 的單元測試 (Unit Test) 將介紹 Jasmine+Karma+Webpack 組合使用。
Blog:
Angular 4 教學 - 單元測試 (Unit Test) Jasmine + Karma + Webpack
安裝軟體的部分我就沒有詳細介紹,以下是我使用到的工具跟語言。
開發工具:
- Visual Studio Code。官網下載頁面
基本上 VS Code 就是純文字編輯工具,你要用 Sublime、Notepade++、Atom、TextEdit都可以。
- Nodejs 6.9.x 以上版本 及 npm 3 以上版本。官網下載頁面
下載範例後記得在專案目錄安裝 npm packages
npm install