- Create
.env
from.env.example
pnpm install
npx cypress install
npm run test
- TypeScript 5.0 introduced support for the
extends
property intsconfig.json
to accept an array of configuration files, allowing you to extend from multiple base configs in one file.- Prior to
TypeScript 5.0
, only a single string path was allowed for theextends
property.
- Prior to
- It turns out that
ts-node
did not fully support the extends array syntax, depending on its version [Ref]. - Therefore, I can only extend one
tsconfig
file and I chose@tsconfig/node-lts/tsconfig.json
.
-
pnpm add -D node-fetch@3 form-data @types/node
-node-fetch@3 เป็น ESM และมี TypeScript types มาให้ในตัวแล้ว -@types/node ใส่เพื่อให้ TS รู้จัก fs, path, stream ต่างๆ` -
form-data: ช่วยสร้าง body แบบ multipart/form-data (แนบไฟล์/ฟิลด์) สำหรับ request ของเรา
-
@types/node: ไทป์ของ Node.js ให้ TypeScript รู้จัก fs, path, stream ฯลฯ (ไม่งั้น TS ฟ้องประเภท)