diff --git a/packages/builder/craco.config.js b/packages/builder/craco.config.js index 8d34c573d3..72ee9b27ff 100644 --- a/packages/builder/craco.config.js +++ b/packages/builder/craco.config.js @@ -29,6 +29,7 @@ module.exports = { require.resolve("jest-transform-stub"), }, setupFilesAfterEnv: ["./src/setupTests.ts"], + testPathIgnorePatterns: ["/e2e/"], }), }, webpack: { diff --git a/packages/builder/tests/homepage.test.ts b/packages/builder/e2e/homepage.test.ts similarity index 100% rename from packages/builder/tests/homepage.test.ts rename to packages/builder/e2e/homepage.test.ts diff --git a/packages/builder/tsconfig.json b/packages/builder/tsconfig.json index ae2dbf52bb..1833b4e711 100644 --- a/packages/builder/tsconfig.json +++ b/packages/builder/tsconfig.json @@ -17,5 +17,6 @@ "jsx": "react-jsx", "sourceMap": true }, - "include": ["src", "craco.config.js", "fixtures.ts", "tests", "playwright.config.js", ".eslintrc.js"] + "include": ["src", "craco.config.js", "fixtures.ts", + "e2e", "playwright.config.js", ".eslintrc.js"] } diff --git a/packages/grant-explorer/tests/homepage.test.ts b/packages/grant-explorer/e2e/homepage.test.ts similarity index 100% rename from packages/grant-explorer/tests/homepage.test.ts rename to packages/grant-explorer/e2e/homepage.test.ts diff --git a/packages/grant-explorer/package.json b/packages/grant-explorer/package.json index 6c7e5d0a88..219294a676 100644 --- a/packages/grant-explorer/package.json +++ b/packages/grant-explorer/package.json @@ -13,7 +13,7 @@ "typecheck": "tsc --noEmit", "typecheck:watch": "tsc --noEmit --watch", "start": "craco start", - "test": "vitest run", + "test": "vitest run ", "test:watch": "vitest watch", "test:coverage": "vitest --coverage" }, @@ -77,6 +77,7 @@ "https-browserify": "^1.0.0", "ipfs-core": "^0.14.3", "ipfs-core-types": "^0.14.0", + "jest": "^27.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "moment": "^2.29.3", diff --git a/packages/grant-explorer/vitest.config.ts b/packages/grant-explorer/vitest.config.ts index 846679fc70..b1ba9a32d1 100644 --- a/packages/grant-explorer/vitest.config.ts +++ b/packages/grant-explorer/vitest.config.ts @@ -1,5 +1,6 @@ import { defineConfig } from "vitest/config"; import react from "@vitejs/plugin-react"; + export default defineConfig({ plugins: [react()], test: { @@ -29,5 +30,13 @@ export default defineConfig({ ["**/*", "node"], ], setupFiles: ["dotenv-flow/config", "src/setupTests.ts"], + exclude: [ + "**/node_modules/**", + "**/dist/**", + "**/cypress/**", + "**/.{idea,git,cache,output,temp}/**", + "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*", + "**/e2e/**", + ], }, }); diff --git a/packages/round-manager/tests/createDgRound.test.ts b/packages/round-manager/e2e/createDgRound.test.ts similarity index 100% rename from packages/round-manager/tests/createDgRound.test.ts rename to packages/round-manager/e2e/createDgRound.test.ts diff --git a/packages/round-manager/tests/createProgram.test.ts b/packages/round-manager/e2e/createProgram.test.ts similarity index 100% rename from packages/round-manager/tests/createProgram.test.ts rename to packages/round-manager/e2e/createProgram.test.ts diff --git a/packages/round-manager/tests/homepage.test.ts b/packages/round-manager/e2e/homepage.test.ts similarity index 100% rename from packages/round-manager/tests/homepage.test.ts rename to packages/round-manager/e2e/homepage.test.ts diff --git a/packages/round-manager/package.json b/packages/round-manager/package.json index 62ffdbc118..2f845dfa6b 100644 --- a/packages/round-manager/package.json +++ b/packages/round-manager/package.json @@ -10,7 +10,7 @@ "scripts": { "start": "craco start", "build": "env REACT_APP_GIT_SHA=$(git rev-parse --short HEAD) craco build", - "test": "craco test --watchAll=false --silent", + "test": "craco test --watchAll=false --silent --testPathIgnorePatterns=e2e", "synpress:test": "playwright test --project=chromium", "test:dev": "craco test --watchAll=true", "test:coverage": "craco test --watchAll=false --silent --coverage", diff --git a/packages/round-manager/tsconfig.json b/packages/round-manager/tsconfig.json index a7d7c8dba7..b28f18d928 100644 --- a/packages/round-manager/tsconfig.json +++ b/packages/round-manager/tsconfig.json @@ -17,5 +17,6 @@ "jsx": "react-jsx", "types": ["@testing-library/jest-dom", "jest", "node"] }, - "include": ["src", "tests", "fixtures.ts"] + "include": ["src", + "e2e", "fixtures.ts"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd35b9ba8d..c0f17447ad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -702,6 +702,9 @@ importers: ipfs-core-types: specifier: ^0.14.0 version: 0.14.1 + jest: + specifier: ^27.0 + version: 27.5.1(ts-node@10.9.1) lodash: specifier: ^4.17.21 version: 4.17.21