yarn add mocha chai --dev
yarn add @types/mocha @types/chai --dev
yarn global add mocha
mocha -r ts-node/register test/index.ts
- Promise 是一个类
- 构造函数:Promise.prototype.constructor
- 静态方法(类方法):Promise.all、Promise.race、Promise.allSettled、Promise.any、Promise.resolve、Promise.reject
- 原型方法(对象方法):Promise.prototype.then、Promise.prototype.catch、Promise.prototype.finally
- 对象状态:state = pending / fulfilled / rejected