@scenarist/nextjs-adapter 0.1.8 → 0.1.10

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.
Files changed (2) hide show
  1. package/README.md +0 -56
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1507,62 +1507,6 @@ The adapter uses **package.json conditional exports** to provide different entry
1507
1507
 
1508
1508
  **For architectural rationale, see:** [Tree-Shaking Investigation](../../docs/investigations/tree-shaking-dynamic-imports-vs-conditional-exports.md)
1509
1509
 
1510
- ---
1511
-
1512
- ## Development & Testing
1513
-
1514
- ### Test Coverage Exception
1515
-
1516
- **For users:** This package is production-ready and fully tested. The function coverage gap described below does not affect functionality or safety - it's an architectural pattern that will be resolved with integration tests in Phase 0.
1517
-
1518
- **For developers:** This package has an explicit exception to the project's 100% coverage requirement.
1519
-
1520
- **Current Coverage:**
1521
-
1522
- - Lines: 100% ✅
1523
- - Statements: 100% ✅
1524
- - Branches: 100% ✅
1525
- - Functions: **93.2%** (explicit exception - improved from 86% after refactoring)
1526
-
1527
- **Reason for Exception:**
1528
-
1529
- Arrow functions passed to `createDynamicHandler()` in `src/common/create-scenarist-base.ts` are only executed when MSW handles actual HTTP requests:
1530
-
1531
- ```typescript
1532
- const handler = createDynamicHandler({
1533
- getTestId: () => currentTestId, // Only called during HTTP request
1534
- getActiveScenario: (testId) => ..., // Only called during HTTP request
1535
- getScenarioDefinition: (scenarioId) => ..., // Only called during HTTP request
1536
- });
1537
- ```
1538
-
1539
- Adapter unit tests focus on Layer 2 (translation layer):
1540
-
1541
- - Request context extraction
1542
- - Endpoint request/response handling
1543
- - Framework-specific edge cases
1544
-
1545
- These tests do NOT make real HTTP requests, so the handler arrow functions are never executed.
1546
-
1547
- **Resolution:**
1548
-
1549
- Phase 0 (Next.js example app) will add integration tests that:
1550
-
1551
- - Make real HTTP requests (like Express example app does with supertest)
1552
- - Trigger MSW handlers
1553
- - Execute the remaining arrow functions
1554
- - Achieve 100% combined coverage across adapter + example app
1555
-
1556
- **Precedent:**
1557
-
1558
- The Express adapter follows the same pattern:
1559
-
1560
- - Adapter unit tests: `packages/express-adapter/tests/`
1561
- - Integration tests: `apps/express-example/tests/` (with supertest)
1562
- - Combined result: 100% coverage
1563
-
1564
- **This is the ONLY explicit exception to the 100% coverage rule in the project.**
1565
-
1566
1510
  ## Documentation
1567
1511
 
1568
1512
  📖 **[Full Documentation](https://scenarist.io)** - Complete guides, API reference, and examples.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scenarist/nextjs-adapter",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Next.js adapter for Scenarist (Pages Router and App Router)",
5
5
  "author": "Paul Hammond (citypaul) <paul@packsoftware.co.uk>",
6
6
  "license": "MIT",
@@ -74,8 +74,8 @@
74
74
  "next": "^14.0.0",
75
75
  "typescript": "^5.9.3",
76
76
  "vitest": "^4.0.14",
77
- "@scenarist/typescript-config": "0.0.0",
78
- "@scenarist/eslint-config": "^0.0.0"
77
+ "@scenarist/eslint-config": "^0.0.0",
78
+ "@scenarist/typescript-config": "0.0.0"
79
79
  },
80
80
  "scripts": {
81
81
  "build": "tsc",