- Published on
๐ ๊ฐ๋ฐํ - `cypress` ์ค์นํ๊ธฐ
- ๊ธ์ด์ด
๐ ๋ชฉ์ฐจ
cypress ์ค์นํ๊ธฐ
bun add cypress -d
๋ก ์ค์นํ ํ
bun run cypress install
๋ก ํ๋ฒ ๋ ์ค์นํด์ค๋ค.
๊ทธ๋ค์
bun run cypress open
๋ฅผ ํด์ cypress
๋ฅผ ์ด์ด์ค๋ค.
tsx
๋ฅผ ์ฌ์ฉํ ๋๋
tsconfig.json
์ tsconfig.node.json
๋ฅผ ๋ง๋ค์ด์ค๋ค.
tsconfig.json
{
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": ".",
"types": ["cypress", "@testing-library/cypress"],
"paths": {
"~/*": ["./src/*"]
}
},
"references": [{ "path": "./tsconfig.node.json" }]
}
tsconfig.node.json
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"rootDir": "..",
"types": ["cypress", "@testing-library/cypress"]
},
"include": ["vite.config.ts"]
}
๊ทธ๋ฆฌ๊ณ ์ฅ์ ์ธ๊ณผ ์ฝ์๋ค์ ์ํ ํ
์คํธ๊น์ง ์งค ์ ์๋ library๋ ์ค์นํด์ฃผ์๋ค.
bun add -d @testing-library/cypress
bun add -d @types/testing-library__cypress