Skip to content

Commit d17effa

Browse files
authored
Move integration tests into test/integ (#328)
This unifies the package & integ tests under one directory, also co-located with test artifacts, resulting a cleaner directory structure. Co-authored-by: Mackenzie Zastrow <[email protected]>
1 parent 314a976 commit d17effa

26 files changed

+35
-34
lines changed

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ sdk-typescript/
9090
│ │ └── README.md # Notebook tool documentation
9191
│ └── README.md # Vended tools overview
9292
93-
├── tests_integ/ # Integration tests (separate from source)
93+
├── test/integ/ # Integration tests (separate from source)
9494
│ ├── bedrock.test.ts # Bedrock integration tests (requires AWS credentials)
9595
│ ├── hooks.test.ts # Hooks integration tests
9696
│ └── registry.test.ts # ToolRegistry integration tests
@@ -140,7 +140,7 @@ sdk-typescript/
140140
- **`src/tools/`**: Tool definitions and types for agent tool use
141141
- **`src/types/`**: Core type definitions used across the SDK
142142
- **`vended_tools/`**: Optional vended tools (not part of core SDK, independently importable)
143-
- **`tests_integ/`**: Integration tests (tests public API and external integrations)
143+
- **`test/integ/`**: Integration tests (tests public API and external integrations)
144144
- **`.github/workflows/`**: CI/CD automation and quality gates
145145
- **`.project/`**: Task management and project tracking
146146

@@ -284,7 +284,7 @@ export async function* mainFunction() {
284284

285285
**For integration tests**:
286286
```
287-
tests_integ/
287+
test/integ/
288288
└── feature.test.ts # Tests public API
289289
```
290290

@@ -669,18 +669,18 @@ src/subdir/
669669

670670
### Integration Test Location
671671

672-
**Rule**: Integration tests are separate in `tests_integ/`
672+
**Rule**: Integration tests are separate in `test/integ/`
673673

674674
```
675-
tests_integ/
675+
test/integ/
676676
├── api.test.ts # Tests public API
677677
└── environment.test.ts # Tests environment compatibility
678678
```
679679

680680
### Test File Naming
681681

682682
- Unit tests: `{sourceFileName}.test.ts` in `src/**/__tests__/**`
683-
- Integration tests: `{feature}.test.ts` in `tests_integ/`
683+
- Integration tests: `{feature}.test.ts` in `test/integ/`
684684

685685
### Test Coverage
686686

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ npm run test:watch
7575
npm run test:integ
7676

7777
# Run integ tests for a single file
78-
npm run test:integ -- tests_integ/openai.test.ts
78+
npm run test:integ -- test/integ/openai.test.ts
7979

8080
# Run browser tests (Chromium)
8181
npm run test:browser
@@ -91,7 +91,7 @@ npm run test:all:coverage
9191

9292
- **80%+ Coverage**: All code should have at least 80% test coverage
9393
- **Unit Tests**: Test individual functions in `src/**/__tests__/**` directories
94-
- **Integration Tests**: Test complete workflows in `tests_integ/` directory
94+
- **Integration Tests**: Test complete workflows in `test/integ/` directory
9595
- **TSDoc Coverage**: All exported functions must have complete documentation
9696

9797
For detailed testing patterns and examples, see [AGENTS.md - Testing Patterns](AGENTS.md#testing-patterns).

eslint.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ export default [
2222
}),
2323
// Apply UT rules to the integ tests
2424
unitTestRules({
25-
files: ['tests_integ/**/*.ts'],
26-
tsconfig: './tests_integ/tsconfig.json',
25+
files: ['test/integ/**/*.ts'],
26+
tsconfig: './test/integ/tsconfig.json',
2727
}),
2828
// Then stricter integ test rules
2929
integTestRules({
30-
files: ['tests_integ/**/*.ts'],
31-
tsconfig: './tests_integ/tsconfig.json',
30+
files: ['test/integ/**/*.ts'],
31+
tsconfig: './test/integ/tsconfig.json',
3232
}),
3333
]
3434

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
"test:all": "vitest run --project unit-node --project unit-browser",
5656
"test:all:coverage": "vitest run --coverage --project unit-node --project unit-browser",
5757
"test:package": "cd test/packages/esm-module && npm install && node esm.js && cd ../cjs-module && npm install && node cjs.js",
58-
"lint": "eslint src tests_integ",
59-
"lint:fix": "eslint src tests_integ --fix",
60-
"format": "prettier --write src tests_integ",
61-
"format:check": "prettier --check src tests_integ",
62-
"type-check": "tsc --noEmit --project src/tsconfig.json && tsc --noEmit --project tests_integ/tsconfig.json",
58+
"lint": "eslint src test/integ",
59+
"lint:fix": "eslint src test/integ --fix",
60+
"format": "prettier --write src test/integ",
61+
"format:check": "prettier --check src test/integ",
62+
"type-check": "tsc --noEmit --project src/tsconfig.json && tsc --noEmit --project test/integ/tsconfig.json",
6363
"type-check:watch": "tsc --noEmit --watch",
6464
"prepare": "npm run build && husky"
6565
},
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { join } from 'node:path'
33

44
/**
55
* Helper to load fixture files from Vite URL imports.
6-
* Vite ?url imports return paths like '/tests_integ/__resources__/file.png' in test environment.
6+
* Vite ?url imports return paths like '/test/integ/__resources__/file.png' in test environment.
77
*
88
* @param url - The URL from a Vite ?url import
99
* @returns The file contents as a Uint8Array
File renamed without changes.

0 commit comments

Comments
 (0)