@scenarist/express-adapter 0.1.5 → 0.1.6
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/README.md +15 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Express.js adapter for [Scenarist](https://scenarist.io) - manage MSW mock scena
|
|
|
7
7
|
|
|
8
8
|
## What is Scenarist?
|
|
9
9
|
|
|
10
|
-
**Scenarist** enables concurrent
|
|
10
|
+
**Scenarist** enables concurrent tests to run with different backend states by switching mock scenarios at runtime via test IDs. Your real application code executes while external API responses are controlled by scenarios. No application restarts needed, no complex per-test mocking, just simple scenario switching.
|
|
11
11
|
|
|
12
12
|
**Before Scenarist:**
|
|
13
13
|
```typescript
|
|
@@ -86,6 +86,18 @@ yarn add -D @scenarist/express-adapter msw
|
|
|
86
86
|
- `express` ^4.18.0 || ^5.0.0
|
|
87
87
|
- `msw` ^2.0.0
|
|
88
88
|
|
|
89
|
+
## 📖 Documentation
|
|
90
|
+
|
|
91
|
+
**Full documentation at [scenarist.io](https://scenarist.io)**
|
|
92
|
+
|
|
93
|
+
| Topic | Link |
|
|
94
|
+
|-------|------|
|
|
95
|
+
| **Why Scenarist?** | [scenarist.io/introduction/why-scenarist](https://scenarist.io/introduction/why-scenarist) |
|
|
96
|
+
| **Getting Started (Express)** | [scenarist.io/frameworks/express/getting-started](https://scenarist.io/frameworks/express/getting-started) |
|
|
97
|
+
| **Parallel Testing** | [scenarist.io/testing/parallel-testing](https://scenarist.io/testing/parallel-testing) |
|
|
98
|
+
| **Testing Philosophy** | [scenarist.io/concepts/philosophy](https://scenarist.io/concepts/philosophy) |
|
|
99
|
+
| **Architecture** | [scenarist.io/concepts/architecture](https://scenarist.io/concepts/architecture) |
|
|
100
|
+
|
|
89
101
|
## Quick Start
|
|
90
102
|
|
|
91
103
|
### 1. Define Scenarios
|
|
@@ -343,7 +355,7 @@ expect(response2.body.error).toBe('No active scenario for this test ID');
|
|
|
343
355
|
|
|
344
356
|
## Core Capabilities
|
|
345
357
|
|
|
346
|
-
Scenarist provides 20+ powerful features for
|
|
358
|
+
Scenarist provides 20+ powerful features for scenario-based testing. All capabilities work seamlessly with Express via automatic test ID propagation.
|
|
347
359
|
|
|
348
360
|
### Request Matching (6 capabilities)
|
|
349
361
|
|
|
@@ -990,7 +1002,7 @@ import type {
|
|
|
990
1002
|
See the [**Express Example App**](../../apps/express-example) for a complete working example demonstrating:
|
|
991
1003
|
|
|
992
1004
|
- ✅ **Runtime scenario switching** - Change API behavior without restart
|
|
993
|
-
- ✅ **Test ID isolation** - 20
|
|
1005
|
+
- ✅ **Test ID isolation** - 20 tests with concurrent scenarios
|
|
994
1006
|
- ✅ **Default fallback** - Partial scenarios automatically falling back
|
|
995
1007
|
- ✅ **Real API integration** - Actual Express routes calling external APIs
|
|
996
1008
|
- ✅ **Multiple scenarios** - Success, errors, timeouts, mixed results
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scenarist/express-adapter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Express middleware adapter for Scenarist",
|
|
5
5
|
"author": "Paul Hammond (citypaul) <paul@packsoftware.co.uk>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"zod": "^4.1.13",
|
|
51
|
-
"@scenarist/
|
|
52
|
-
"@scenarist/
|
|
51
|
+
"@scenarist/msw-adapter": "0.1.2",
|
|
52
|
+
"@scenarist/core": "0.1.2"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"express": "^4.18.0 || ^5.0.0",
|