@scenarist/core 0.2.0 → 0.2.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-selector.d.ts","sourceRoot":"","sources":["../../src/domain/response-selector.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACb,MAAM,mBAAmB,CAAC;AAe3B;;GAEG;AACH,KAAK,6BAA6B,GAAG;IACnC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAS,6BAAkC,KAC1C,
|
|
1
|
+
{"version":3,"file":"response-selector.d.ts","sourceRoot":"","sources":["../../src/domain/response-selector.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACb,MAAM,mBAAmB,CAAC;AAe3B;;GAEG;AACH,KAAK,6BAA6B,GAAG;IACnC,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAS,6BAAkC,KAC1C,gBAyIF,CAAC"}
|
|
@@ -55,9 +55,10 @@ export const createResponseSelector = (options = {}) => {
|
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
57
|
// No match criteria = fallback mock (always matches)
|
|
58
|
-
//
|
|
59
|
-
// This ensures
|
|
60
|
-
|
|
58
|
+
// Dynamic response types (sequence, stateResponse) get higher priority than simple responses
|
|
59
|
+
// This ensures they are selected over simple fallback responses
|
|
60
|
+
// Both sequence and stateResponse get the same specificity (Issue #316 fix)
|
|
61
|
+
const fallbackSpecificity = mock.sequence || mock.stateResponse
|
|
61
62
|
? SPECIFICITY_RANGES.SEQUENCE_FALLBACK
|
|
62
63
|
: SPECIFICITY_RANGES.SIMPLE_FALLBACK;
|
|
63
64
|
if (!bestMatch || fallbackSpecificity >= bestMatch.specificity) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scenarist/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Internal: Hexagonal architecture core for scenario-based testing with MSW",
|
|
5
5
|
"author": "Paul Hammond (citypaul) <paul@packsoftware.co.uk>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"fast-check": "^4.3.0",
|
|
57
57
|
"typescript": "^5.9.3",
|
|
58
58
|
"vitest": "^4.0.14",
|
|
59
|
-
"@scenarist/
|
|
60
|
-
"@scenarist/
|
|
59
|
+
"@scenarist/eslint-config": "0.0.0",
|
|
60
|
+
"@scenarist/typescript-config": "0.0.0"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsc",
|