test: move test files, add ts configs
This commit is contained in:
+12
-13
@@ -14,17 +14,15 @@ src/
|
||||
├── ports.ts # Интерфейсы: IFileSystem, ITaskRepository, IConfigProvider
|
||||
├── storage/
|
||||
│ ├── FsTaskRepository.ts # ITaskRepository → зависит только от IFileSystem, markdown, uuid
|
||||
│ ├── FsTaskRepository.test.ts # unit (sociable) — colocation с модулем
|
||||
│ ├── VscodeConfigProvider.ts # IConfigProvider → зависит от vscode
|
||||
│ └── NodeFileSystem.ts # IFileSystem → обёртка над fs.promises
|
||||
├── utils/
|
||||
│ └── markdown.test.ts # unit — colocation
|
||||
|
||||
tests/
|
||||
├── utils/
|
||||
│ ├── markdown.test.ts
|
||||
│ └── uuid.test.ts
|
||||
├── storage/
|
||||
│ ├── FsTaskRepository.test.ts
|
||||
│ └── helpers/
|
||||
│ └── InMemoryFileSystem.ts
|
||||
└── helpers/
|
||||
└── InMemoryFileSystem.ts # shared fakes; integration/e2e — сюда же позже
|
||||
```
|
||||
|
||||
### Удалить
|
||||
@@ -46,12 +44,13 @@ tests/
|
||||
|
||||
## Тесты
|
||||
|
||||
| Тест | I/O | Что проверяет |
|
||||
| ------------------ | ------------------------ | -------------------------------------------- |
|
||||
| FsTaskRepository | InMemoryFileSystem (Map) | CRUD, фильтрация по extension, контент файла |
|
||||
| markdown | — | parse, serialize, round-trip, default-ы |
|
||||
| uuid | — | валидный формат, уникальность |
|
||||
| InMemoryFileSystem | — | read/write/readdir/mkdir |
|
||||
| Тест | Где | I/O | Что проверяет |
|
||||
| ---------------- | ----------------------- | ------------------------ | -------------------------------------------- |
|
||||
| FsTaskRepository | `src/storage/*.test.ts` | InMemoryFileSystem (Map) | CRUD, фильтрация по extension, контент файла |
|
||||
| markdown | `src/utils/*.test.ts` | — | parse, serialize, round-trip, default-ы |
|
||||
|
||||
Unit/sociable unit — рядом с модулем (`src/**/*.test.ts`).
|
||||
Shared fakes и будущие integration/e2e — в `tests/`.
|
||||
|
||||
## Что НЕ тестируем (пока)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user