bmad-method-test-architecture-enterprise 1.5.2 → 1.5.3
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "bmad-method-test-architecture-enterprise",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.3",
|
|
5
5
|
"description": "Master Test Architect for quality strategy, test automation, and release gates",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"bmad",
|
package/release_notes.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
## 🚀 What's New in v1.5.
|
|
2
|
-
|
|
3
|
-
### ✨ New Features
|
|
4
|
-
- feat: harden pact framework and knowledge
|
|
1
|
+
## 🚀 What's New in v1.5.3
|
|
5
2
|
|
|
6
3
|
### 🐛 Bug Fixes
|
|
7
|
-
- fix:
|
|
4
|
+
- fix: tweak pactjs instructions
|
|
8
5
|
|
|
9
6
|
### 📦 Other Changes
|
|
10
|
-
- Merge pull request #
|
|
7
|
+
- Merge pull request #52 from bmad-code-org/fix/tweak-pactjs-instructions
|
|
11
8
|
|
|
12
9
|
|
|
13
10
|
## 📦 Installation
|
|
@@ -17,4 +14,4 @@ npx bmad-method install
|
|
|
17
14
|
# Select "Test Architect" from module menu
|
|
18
15
|
```
|
|
19
16
|
|
|
20
|
-
**Full Changelog**: https://github.com/bmad-code-org/bmad-method-test-architecture-enterprise/compare/v1.5.
|
|
17
|
+
**Full Changelog**: https://github.com/bmad-code-org/bmad-method-test-architecture-enterprise/compare/v1.5.2...v1.5.3
|
|
@@ -130,7 +130,7 @@ describe('User API Contract', () => {
|
|
|
130
130
|
'Content-Type': 'application/json',
|
|
131
131
|
Accept: 'application/json',
|
|
132
132
|
},
|
|
133
|
-
body:
|
|
133
|
+
body: newUser,
|
|
134
134
|
})
|
|
135
135
|
.willRespondWith({
|
|
136
136
|
status: 201,
|
|
@@ -176,7 +176,7 @@ describe('User API Contract', () => {
|
|
|
176
176
|
**Key Points**:
|
|
177
177
|
|
|
178
178
|
- **Consumer-driven**: Frontend defines expectations, not backend
|
|
179
|
-
- **Matchers**: `like`, `string`, `integer` for flexible matching
|
|
179
|
+
- **Matchers (Postel's Law)**: Use `like`, `string`, `integer` matchers in `willRespondWith` (responses) for flexible matching. Do NOT use `like()` on request bodies in `withRequest` — the consumer controls what it sends, so request bodies should use exact values. This follows Postel's Law: be strict in what you send (requests), be lenient in what you accept (responses).
|
|
180
180
|
- **Provider states**: given() sets up test preconditions
|
|
181
181
|
- **Isolation**: No real backend needed, runs fast
|
|
182
182
|
- **Pact generation**: Automatically creates JSON pact files
|
|
@@ -418,15 +418,15 @@ describe('Movies API Consumer Contract', () => {
|
|
|
418
418
|
)
|
|
419
419
|
.willRespondWith(
|
|
420
420
|
200,
|
|
421
|
-
|
|
422
|
-
|
|
421
|
+
setJsonBody(
|
|
422
|
+
like({
|
|
423
423
|
id: integer(1),
|
|
424
424
|
name: string('The Matrix'),
|
|
425
425
|
year: integer(1999),
|
|
426
426
|
rating: like(8.7),
|
|
427
427
|
director: string('Wachowskis'),
|
|
428
428
|
}),
|
|
429
|
-
|
|
429
|
+
),
|
|
430
430
|
)
|
|
431
431
|
.executeTest(async (mockServer: V3MockServer) => {
|
|
432
432
|
// Inject mock server URL into the REAL consumer code
|
|
@@ -617,6 +617,8 @@ Before presenting the consumer CDC framework to the user, verify:
|
|
|
617
617
|
- [ ] Consumer tests use `.pacttest.ts` extension
|
|
618
618
|
- [ ] Consumer tests use PactV4 `addInteraction()` builder
|
|
619
619
|
- [ ] Interaction callbacks use `setJsonContent` for query/header/body and `setJsonBody` for body-only responses
|
|
620
|
+
- [ ] Request bodies use exact values (no `like()` wrapper) — Postel's Law: be strict in what you send
|
|
621
|
+
- [ ] `like()`, `eachLike()`, `string()`, `integer()` matchers are only used in `willRespondWith` (responses), not in `withRequest` (requests)
|
|
620
622
|
- [ ] Consumer tests call REAL consumer code (actual API client functions), NOT raw `fetch()`
|
|
621
623
|
- [ ] Consumer code exposes URL injection mechanism (`setApiUrl()`, env var, or constructor param)
|
|
622
624
|
- [ ] Local consumer-helpers shim present if pactjs-utils not installed
|
|
@@ -97,6 +97,7 @@ test.describe('[Feature] API Tests', () => {
|
|
|
97
97
|
- ✅ Generate request filter helpers in `pact/http/helpers/` using `createRequestFilter({ tokenGenerator: () => string })`
|
|
98
98
|
- ✅ Generate shared state constants in `pact/http/helpers/states.ts`
|
|
99
99
|
- ✅ If async/message patterns detected, generate message consumer tests in `pact/message/` using `buildMessageVerifierOptions`
|
|
100
|
+
- ⚠️ **Postel's Law for matchers**: Use `like()`, `eachLike()`, `string()`, `integer()` matchers ONLY in `willRespondWith` (responses). Request bodies in `withRequest` MUST use exact values — never wrap request bodies in `like()`. The consumer controls what it sends, so contracts should be strict about request shape.
|
|
100
101
|
|
|
101
102
|
### 3. Track Fixture Needs
|
|
102
103
|
|