@slbdn/mcp-tester 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -79
- package/README.md +333 -1406
- package/dist/assert.d.ts +75 -0
- package/dist/assert.d.ts.map +1 -0
- package/dist/assert.js +250 -0
- package/dist/assert.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +311 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client/MCPClient.d.ts +316 -0
- package/dist/client/MCPClient.d.ts.map +1 -1
- package/dist/client/MCPClient.js +270 -28
- package/dist/client/MCPClient.js.map +1 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -1
- package/dist/index.js.map +1 -1
- package/dist/matchers.d.ts +262 -0
- package/dist/matchers.d.ts.map +1 -0
- package/dist/matchers.js +527 -0
- package/dist/matchers.js.map +1 -0
- package/dist/utils/errors.d.ts +80 -4
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +123 -6
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/logger.d.ts +88 -4
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +131 -8
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/masking.d.ts +66 -0
- package/dist/utils/masking.d.ts.map +1 -0
- package/dist/utils/masking.js +171 -0
- package/dist/utils/masking.js.map +1 -0
- package/package.json +34 -5
- package/vitest.d.ts +51 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,94 +5,98 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [1.2.0] - 2026-04-30
|
|
9
9
|
|
|
10
|
-
###
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
-
|
|
14
|
-
- Fixed `@ts-ignore` usage in test files — replaced with `@ts-expect-error` per project conventions
|
|
15
|
-
- Fixed `any` types in `resources-prompts.test.ts` — replaced with proper `MCPClient` type and removed duplicate dynamic imports
|
|
16
|
-
- Fixed `setElicitationHandler()` to use proper TypeScript types instead of `any`
|
|
10
|
+
### Added
|
|
11
|
+
- **Code coverage comments on PRs** — GitHub Actions workflow now posts a coverage table as a sticky comment on every pull request (statements/branches/functions/lines with thresholds)
|
|
12
|
+
- **Dedicated `coverage` CI job** — runs on single Node.js version (faster than matrix), generates `coverage-summary.json`, uploads to Codecov v4
|
|
13
|
+
- **`coverageReporters`** in `jest.config.js` — added `json-summary` reporter for CI coverage data extraction
|
|
17
14
|
|
|
18
15
|
### Changed
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
16
|
+
- **Per-file coverage thresholds** updated for new files (`masking.ts`, `logger.ts`) and actual coverage numbers
|
|
17
|
+
- Global thresholds: 67% statements, 61% branches, 60% functions, 67% lines (was 76/57/64/76)
|
|
18
|
+
- **README** coverage badge and table updated with real numbers (68/61/60/68)
|
|
19
|
+
- **docs/cicd.md** — rewritten with full workflow including coverage job, PR comments, and Codecov
|
|
20
|
+
- **docs/testing.md** — updated coverage thresholds (was "80%", now per-file table)
|
|
21
|
+
- **AGENTS.md** — updated test count, coverage stats, CI job descriptions, file listing
|
|
22
|
+
- Fixed flaky `delay` test (100ms → 90ms tolerance for timing variance)
|
|
23
|
+
|
|
24
|
+
## [1.1.0] - 2026-04-23
|
|
24
25
|
|
|
25
26
|
### Added
|
|
26
|
-
-
|
|
27
|
-
- `
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
- `
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- `
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- `validateToolResult(result)` - Validate result
|
|
70
|
-
- `src/__tests__/helpers-example.test.ts` - Usage examples
|
|
71
|
-
- Updated `src/__tests__/client.test.ts` to use helpers
|
|
72
|
-
- Documentation in README.md for helpers and matchers with usage examples
|
|
27
|
+
- **Assertion module** (`src/assert.ts`) — 30+ framework-agnostic assertion functions:
|
|
28
|
+
- Value: `equal`, `notEqual`, `deepEqual`, `ok`, `notOk`, `throws`, `doesNotThrow`
|
|
29
|
+
- Numeric: `equalNum`, `greaterThan`, `atLeast`, `lessThan`, `closeTo`
|
|
30
|
+
- String: `contains`, `notContains`, `matches`
|
|
31
|
+
- Tool results: `toolTextEquals`, `toolTextContains`, `toolNumEquals`, `toolNumCloseTo`, `toolJsonEquals`, `toolIsError`, `toolIsOk`, `toolHasContent`, `toolHasImage`
|
|
32
|
+
- Resources: `resourceHasContent`, `resourceTextContains`
|
|
33
|
+
- Prompts: `promptHasMessages`, `promptTextContains`
|
|
34
|
+
- Exported as `assert` namespace and `AssertionError` class
|
|
35
|
+
- **20 custom Jest/Vitest matchers** for MCP-specific assertions:
|
|
36
|
+
- Collection: `toHaveTool`, `toHaveToolWithSchema`, `toHaveToolCount`, `toHaveResource`, `toHaveResourceByName`, `toHaveResourceCount`, `toHavePrompt`, `toHavePromptWithArgs`, `toHavePromptCount`
|
|
37
|
+
- Tool results: `toReturnText`, `toReturnTextContaining`, `toReturnError`, `toReturnOk`, `toReturnJson`, `toReturnContentCount`, `toReturnImage`
|
|
38
|
+
- Resource results: `toReturnResourceText`, `toReturnResourceTextContaining`
|
|
39
|
+
- Prompt results: `toReturnPromptTextContaining`, `toReturnPromptMessageCount`
|
|
40
|
+
- **Vitest support** — all matchers work with Vitest via `setupVitestMatchers()`:
|
|
41
|
+
- `vitest.d.ts` type declarations included in package
|
|
42
|
+
- `setupJestMatchers()` (renamed from `setupCustomMatchers`, kept as alias)
|
|
43
|
+
- `setupVitestMatchers()` for Vitest environments
|
|
44
|
+
- Same `{ pass, message }` format, works identically in both frameworks
|
|
45
|
+
- **Standalone assertion wrappers** in `matchers.ts` for non-Jest usage: `assertHasTool`, `assertHasResource`, `assertHasPrompt`, `assertToolText`, `assertToolTextContains`
|
|
46
|
+
- **CLI tool** with shebang (`#!/usr/bin/env node`) for proper `npx` support
|
|
47
|
+
- **Examples** added to `examples/`:
|
|
48
|
+
- `everything-server-test.ts` — full test against real `@modelcontextprotocol/server-everything`
|
|
49
|
+
- `jest-matchers-example.ts` — demonstrates all 20 Jest matchers (20 tests)
|
|
50
|
+
- `assert-example.ts` — demonstrates all assert utilities (20 tests)
|
|
51
|
+
- **Documentation reorganization** — README condensed from 1610 to ~200 lines:
|
|
52
|
+
- `docs/api-reference.md` — full method docs, types, error classes, assert & matchers tables
|
|
53
|
+
- `docs/testing.md` — writing tests, Jest/Vitest setup, matchers, assert module, mock server
|
|
54
|
+
- `docs/examples.md` — practical code examples for Jest, Vitest, and assert
|
|
55
|
+
- `docs/advanced.md` — timeouts, retries, concurrency, notifications, logging
|
|
56
|
+
- `docs/cli.md` — CLI commands, options, output formats
|
|
57
|
+
- `docs/cicd.md` — GitHub Actions, CircleCI, Jenkins configs
|
|
58
|
+
- `docs/troubleshooting.md` — common issues, Vitest setup, solutions
|
|
59
|
+
- `docs/releases.md` — release process and commands
|
|
60
|
+
- `docs/nodejs-compatibility.md` — version matrix, upgrade guide
|
|
61
|
+
- **README improvements**:
|
|
62
|
+
- "This is not your grandpa's MCP Inspector" intro
|
|
63
|
+
- Capabilities table (9 categories)
|
|
64
|
+
- Parallel execution section with `Promise.all` examples
|
|
65
|
+
- Assertion utilities section with full API table
|
|
66
|
+
- Custom Jest matchers section with all 20 matchers
|
|
67
|
+
- Vitest setup section
|
|
68
|
+
- Removed old `CLI.md` (replaced by `docs/cli.md`)
|
|
69
|
+
- **227 tests** (up from 111) — new `assert.test.ts` (67 tests) and `matchers.test.ts` (49 tests)
|
|
73
70
|
|
|
74
71
|
### Changed
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
### Fixed
|
|
84
|
-
- Type safety issues with environment variable merging
|
|
85
|
-
- Process cleanup now properly handles both SIGTERM and SIGKILL
|
|
86
|
-
- Typo in AGENTS.md: "Security Considerations" fixed (was "Security Considerations")
|
|
87
|
-
|
|
88
|
-
### Deprecated
|
|
89
|
-
- None
|
|
72
|
+
- **`MCPTimeoutError` and `MCPConnectionError` are now actually thrown** — `start()` catches connection errors as `MCPConnectionError`, `wrapError()` detects timeout errors and throws `MCPTimeoutError`
|
|
73
|
+
- **CLI** rewritten to use Commander's native `help` and `version` handling instead of duplicated logic
|
|
74
|
+
- **Example imports** fixed: `../index.js` → `../dist/index.js` (examples now actually run with `npx tsx`)
|
|
75
|
+
- **Matchers** moved from `src/__tests__/matchers.ts` to `src/matchers.ts` and exported publicly
|
|
76
|
+
- **Test helper server path** fixed: `./dist/__tests__/fixtures/mock-server.js` → `./examples/mock-server.js`
|
|
77
|
+
- Husky `prepare` script now handles Node.js v24 incompatibility (`"husky || true"`)
|
|
78
|
+
- `tsconfig.json` excludes `src/__tests__` from compilation — `dist/` now has only library files (28)
|
|
79
|
+
- `toolTextEquals()` now accepts optional `expected` param — can be used as "has any text" check
|
|
90
80
|
|
|
91
81
|
### Removed
|
|
92
|
-
-
|
|
82
|
+
- **`src/__tests__/helpers.ts`** — removed dead code (was only used once, `new MCPClient()` is simpler)
|
|
83
|
+
- **`src/__tests__/helpers-example.test.ts`** — removed (demonstrated unused helpers)
|
|
84
|
+
- **`src/__tests__/matchers.ts`** — moved to `src/matchers.ts` (now a public export)
|
|
85
|
+
- **`CLI.md`** — replaced by `docs/cli.md`
|
|
86
|
+
- **`toBeConnectedClient`** matcher — removed (never had real implementation)
|
|
87
|
+
- All `any` types removed from `mock-server.ts` — replaced with proper TypeScript interfaces
|
|
88
|
+
- Documentation references to removed helpers, old import paths, and stale test counts
|
|
93
89
|
|
|
94
|
-
###
|
|
95
|
-
-
|
|
90
|
+
### Fixed
|
|
91
|
+
- **Two failing tests** in `everything-server.test.ts`:
|
|
92
|
+
- `trigger-long-running-operation`: `duration` parameter is in seconds, not milliseconds
|
|
93
|
+
- `args-prompt`: requires `city` argument, not `name`
|
|
94
|
+
- **MCPClient error handling**: catches in `start()`, `listTools()`, `callTool()`, `listResources()`, `readResource()`, `listPrompts()`, and `getPrompt()` now throw proper error subclasses instead of generic `MCPServerError`
|
|
95
|
+
- **Husky compatibility** with Node.js v24+ (exit code issue)
|
|
96
|
+
- **Test helper import paths** across all test files
|
|
97
|
+
- **CLI version format**: now outputs plain `1.1.0` instead of `mcp-tester v1.1.0`
|
|
98
|
+
- **Package name** in RELEASE.md and CONTRIBUTING.md: `mcp-tester` → `@slbdn/mcp-tester`
|
|
99
|
+
- **Repo URLs** in RELEASE.md and CONTRIBUTING.md: `your-username` → `islobodan`
|
|
96
100
|
|
|
97
101
|
## [1.0.0] - 2026-01-19
|
|
98
102
|
|
|
@@ -103,4 +107,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
103
107
|
- Mock MCP server for unit testing
|
|
104
108
|
- TypeScript support with full type definitions
|
|
105
109
|
- CI/CD pipeline with GitHub Actions
|
|
106
|
-
- Comprehensive documentation and examples
|
|
110
|
+
- Comprehensive documentation and examples
|