- 安裝 jest: npm install jest --save-dev
- 生成 jest.config.js: npx jest --init (呼叫 node_modules 裡面的 jest命令,進行jest的初始化)
- 安裝 vscode jest 插件 (可自動化測試是否成功)
- 新增測試檔案
- transaction.js (要測試的程式檔)
- transaction.test.js (該程式的測試檔)
- 新增 package.json scripts 指令
- "test": "jest" (執行測試)
- "watch": "jest --watchAll" (持續用監控的形式,而非單一次報告)
-
Notifications
You must be signed in to change notification settings - Fork 0
partyyaya/JestLearning
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published