手写 promise + jest 单元测试
TODO
- 多个.then,后面的.then 会丢失类型
- .catch 还没测试链式调用
- .then 的链式穿透
当前项目下开启 ts 的调试模式
- 点击 terminal -> run tasks -> tsc watch - tsconfig.json
- 给对应的位置打断点
- f5 运行 debug
更多 debug 方式参考
关于 jest 运行单元测试时,开启 ts 检测
https://github.com/kulshekhar/ts-jest
关于启动 ts 实时转译
点击terminal -> run tasks -> tsc watch - tsconfig.json
关于 js 调试方法
node --inspect-brk ./.jest/test1.test.js
cmd + shift + p -> debug attach node
关于 ts 调试方法
https://kiwi-jacket-c6b.notion.site/vs-code-ts-6d8d4365f6694df08a3fe1da69e64e9f