Skip to content

Commit

Permalink
chore: separate e2e and integration test scripts (#55)
Browse files Browse the repository at this point in the history
Requirement: separate e2e and integration test scripts.

Tests:
- Unit (15 tests)
<img width="823" alt="image" src="https://github.com/alchemyplatform/aa-sdk/assets/43521356/25f3c843-385a-4d0e-87a4-e85e3808b052">

- E2E (26 tests)
<img width="725" alt="image" src="https://github.com/alchemyplatform/aa-sdk/assets/43521356/6a9cd8b0-a707-492e-804d-ec3c1e573a64">



<!-- start pr-codex -->

---

## PR-Codex overview
### Focus of this PR:
This PR focuses on adding e2e test configurations for different packages and updating the test script in the package.json file.

### Detailed summary:
- Deleted `vitest.config.ts` and `vitest.workspace.ts` files.
- Updated the `test:run` script in the `package.json` file for the `core`, `ethers`, `accounts`, and `alchemy` packages.
- Added `vitest.config.e2e.ts` files for the `core`, `ethers`, `accounts`, and `alchemy` packages.
- Updated the `test` script in the `package.json` file to run tests using `lerna run test:run`.
- Added `test:e2e` script in the `package.json` file to run end-to-end tests.
- Added e2e test configurations in the `vitest.config.e2e.ts` files for the `core`, `ethers`, `accounts`, and `alchemy` packages.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
avasisht23 authored and rthomare committed Jul 29, 2023
1 parent 5b6cbb2 commit 252b5c7
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 18 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build": "lerna run build --ignore=alchemy-daapp",
"build:examples": "lerna run build",
"clean": "lerna run clean",
"test": "vitest run",
"test": "lerna run test:run",
"test:e2e": "lerna run test:run-e2e",
"lint:write": "eslint . --fix && prettier --write --ignore-unknown .",
"lint:check": "eslint . && prettier --check .",
"prepare": "husky install",
Expand Down
3 changes: 2 additions & 1 deletion packages/accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"clean": "rm -rf ./dist",
"test": "vitest",
"test:run": "vitest run"
"test:run": "vitest run",
"test:run-e2e": "vitest run --config vitest.config.e2e.ts"
},
"devDependencies": {
"@alchemy/aa-core": "^0.1.0-alpha.17",
Expand Down
11 changes: 11 additions & 0 deletions packages/accounts/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/__tests__/**/*.test.ts"],
name: "accounts",
},
});
4 changes: 3 additions & 1 deletion packages/accounts/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { defineProject } from "vitest/config";
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/e2e-tests/**/*.test.ts"],
name: "accounts",
},
});
3 changes: 2 additions & 1 deletion packages/alchemy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"clean": "rm -rf ./dist",
"test": "vitest",
"test:run": "vitest run"
"test:run": "vitest run",
"test:run-e2e": "vitest run --config vitest.config.e2e.ts"
},
"devDependencies": {
"@alchemy/aa-core": "^0.1.0-alpha.17",
Expand Down
11 changes: 11 additions & 0 deletions packages/alchemy/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/__tests__/**/*.test.ts"],
name: "aa-alchemy",
},
});
4 changes: 3 additions & 1 deletion packages/alchemy/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { defineProject } from "vitest/config";
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/e2e-tests/**/*.test.ts"],
name: "aa-alchemy",
},
});
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"clean": "rm -rf ./dist",
"test": "vitest",
"test:run": "vitest run"
"test:run": "vitest run",
"test:run-e2e": "vitest run --config vitest.config.e2e.ts"
},
"devDependencies": {
"dotenv": "^16.0.3",
Expand Down
11 changes: 11 additions & 0 deletions packages/core/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/__tests__/**/*.test.ts"],
name: "core",
},
});
4 changes: 3 additions & 1 deletion packages/core/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { defineProject } from "vitest/config";
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/e2e-tests/**/*.test.ts"],
name: "core",
},
});
3 changes: 2 additions & 1 deletion packages/ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"clean": "rm -rf ./dist",
"test": "vitest",
"test:run": "vitest run"
"test:run": "vitest run",
"test:run-e2e": "vitest run --config vitest.config.e2e.ts"
},
"devDependencies": {
"@alchemy/aa-core": "^0.1.0-alpha.17",
Expand Down
11 changes: 11 additions & 0 deletions packages/ethers/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/__tests__/**/*.test.ts"],
name: "ethers",
},
});
4 changes: 3 additions & 1 deletion packages/ethers/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { defineProject } from "vitest/config";
import { configDefaults, defineProject } from "vitest/config";

export default defineProject({
test: {
singleThread: true,
globals: true,
setupFiles: ["../../.vitest/setupTests.ts"],
exclude: [...configDefaults.exclude, "**/e2e-tests/**/*.test.ts"],
name: "ethers",
},
});
7 changes: 0 additions & 7 deletions vitest.config.ts

This file was deleted.

2 changes: 0 additions & 2 deletions vitest.workspace.ts

This file was deleted.

0 comments on commit 252b5c7

Please sign in to comment.