Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E 테스트 추가 설정 #321 #333

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
"next/core-web-vitals",
"plugin:cypress/recommended"
],
"overrides": [
{
"files": ["cypress/**/*.ts", "cypress.config.ts"],
"parserOptions": {
"project": "./cypress/tsconfig.json"
}
}
],
"settings": {
"import/resolver": {
"typescript": {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# testing
/coverage
cypress.env.json
cypress/downloads

# next.js
/.next/
Expand Down
23 changes: 19 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { fileURLToPath } from "url";
import webpack from "@cypress/webpack-preprocessor";
import { defineConfig } from "cypress";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
Expand All @@ -12,12 +15,24 @@ export default defineConfig({
resolve: {
extensions: [".ts", ".tsx"],
alias: {
cypress: path.resolve(
dirname(fileURLToPath(import.meta.url)),
"cypress"
),
cypress: path.resolve(__dirname, "cypress"),
src: path.resolve(__dirname, "src"),
},
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: "ts-loader",
options: { transpileOnly: true },
},
],
exclude: /node_modules/,
},
],
},
},
});
on("file:preprocessor", options);
Expand Down
15 changes: 11 additions & 4 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node", "./support"]
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"lib": ["esnext", "dom"],
"types": ["cypress", "node", "./support"],
"esModuleInterop": true,
"paths": {
"cypress/*": ["./cypress/*"],
"src/*": ["../src/*"]
}
},
"include": ["**/*.ts"]
"include": ["./**/*.ts", "../cypress.config.ts"]
}
41 changes: 41 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@cypress/webpack-preprocessor": "^6.0.2",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@types/cypress": "^1.1.3",
"@types/jest": "^29.5.12",
"@types/node": "^20",
"@types/qrcode": "^1.5.5",
Expand All @@ -74,6 +75,7 @@
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.8",
"ts-jest": "^29.1.5",
"ts-loader": "^9.5.1",
"typescript": "^5"
}
}
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
}
],
"paths": {
"@/*": ["./src/*"],
"cypress/*": ["./cypress/*"]
"@/*": ["./src/*"]
},
"strictNullChecks": true
},
Expand All @@ -35,9 +34,9 @@
],
"exclude": [
"node_modules",
"**/*.spec.ts",
"./cypress.config.ts",
"cypress",
"**/*.spec.ts",
"**/*.cy.ts"
]
}