Skip to content

FullstackTypeScript68/Testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  • Create .env from .env.example
  • pnpm install
  • npx cypress install
  • npm run test

Setup from scratch

Issue

  • TypeScript 5.0 introduced support for the extends property in tsconfig.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 the extends property.
  • 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.

package

  • 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 ฟ้องประเภท)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •