norn-cli 1.3.12 → 1.3.14

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 CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to the "Norn" extension will be documented in this file.
4
4
 
5
+ ## [1.3.14] - 2026-02-12
6
+
7
+ ### Fixed
8
+ - **Assertion Equality for Objects/Arrays**: `==` and `!=` now perform deep structural comparison for objects and arrays
9
+ - `assert $1.body.args == {}` now correctly passes for empty-object payloads
10
+ - Scalar comparisons retain existing coercion behavior
11
+ - **Regression Stability**: Updated empty-literals regression coverage for current `httpbin` behavior
12
+ - `files` in `GET /get` may be omitted, so the test now asserts `!exists`
13
+
14
+ ## [1.3.13] - 2026-02-10
15
+
16
+ ### Fixed
17
+ - **Script Variable Resolution**: Fixed `print` showing raw command text instead of script output
18
+ - `extractVariables` now skips runtime-computed values (`var x = run ...`, `var x = $1...`, `var x = METHOD url`)
19
+ - Variables are only pre-populated for static assignments, not scripts/captures
20
+ - **Test Explorer Script Paths**: Fixed script path resolution when running tests through Test Explorer
21
+ - Scripts in imported sequences now resolve relative to the imported file, not the importing file
22
+ - Added `sequenceSources` parameter to Test Explorer execution path
23
+
5
24
  ## [1.3.12] - 2026-02-10
6
25
 
7
26
  ### Fixed
package/dist/cli.js CHANGED
@@ -18983,6 +18983,52 @@ function getNestedValue2(obj, path5) {
18983
18983
  }
18984
18984
  return current;
18985
18985
  }
18986
+ function areValuesEqual(leftValue, rightValue) {
18987
+ if (leftValue === rightValue) {
18988
+ return true;
18989
+ }
18990
+ if (leftValue === null || rightValue === null || leftValue === void 0 || rightValue === void 0) {
18991
+ return leftValue === rightValue;
18992
+ }
18993
+ const leftIsArray = Array.isArray(leftValue);
18994
+ const rightIsArray = Array.isArray(rightValue);
18995
+ if (leftIsArray || rightIsArray) {
18996
+ if (!leftIsArray || !rightIsArray) {
18997
+ return false;
18998
+ }
18999
+ if (leftValue.length !== rightValue.length) {
19000
+ return false;
19001
+ }
19002
+ for (let i = 0; i < leftValue.length; i++) {
19003
+ if (!areValuesEqual(leftValue[i], rightValue[i])) {
19004
+ return false;
19005
+ }
19006
+ }
19007
+ return true;
19008
+ }
19009
+ const leftIsObject = typeof leftValue === "object";
19010
+ const rightIsObject = typeof rightValue === "object";
19011
+ if (leftIsObject || rightIsObject) {
19012
+ if (!leftIsObject || !rightIsObject) {
19013
+ return false;
19014
+ }
19015
+ const leftKeys = Object.keys(leftValue);
19016
+ const rightKeys = Object.keys(rightValue);
19017
+ if (leftKeys.length !== rightKeys.length) {
19018
+ return false;
19019
+ }
19020
+ for (const key of leftKeys) {
19021
+ if (!Object.prototype.hasOwnProperty.call(rightValue, key)) {
19022
+ return false;
19023
+ }
19024
+ if (!areValuesEqual(leftValue[key], rightValue[key])) {
19025
+ return false;
19026
+ }
19027
+ }
19028
+ return true;
19029
+ }
19030
+ return leftValue == rightValue;
19031
+ }
18986
19032
  function evaluateAssertion(assertion, responses, variables, getValueByPath2, responseIndexToVariable, basePath) {
18987
19033
  const leftResult = resolveValue(assertion.leftExpr, responses, variables, getValueByPath2, responseIndexToVariable);
18988
19034
  const buildFailureContext = () => ({
@@ -19106,10 +19152,10 @@ function evaluateAssertion(assertion, responses, variables, getValueByPath2, res
19106
19152
  let passed = false;
19107
19153
  switch (assertion.operator) {
19108
19154
  case "==":
19109
- passed = leftValue == rightValue;
19155
+ passed = areValuesEqual(leftValue, rightValue);
19110
19156
  break;
19111
19157
  case "!=":
19112
- passed = leftValue != rightValue;
19158
+ passed = !areValuesEqual(leftValue, rightValue);
19113
19159
  break;
19114
19160
  case ">":
19115
19161
  passed = Number(leftValue) > Number(rightValue);
@@ -20032,9 +20078,21 @@ function getNamedRequest(text, name) {
20032
20078
  function extractVariables(text) {
20033
20079
  const variables = {};
20034
20080
  const variableRegex = /^\s*var\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.+)$/gm;
20081
+ const runtimePatterns = [
20082
+ /^run\s+/i,
20083
+ // var x = run ... (scripts/sequences)
20084
+ /^\$\d+/,
20085
+ // var x = $1... (response captures)
20086
+ /^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+/i
20087
+ // var x = METHOD url (request captures)
20088
+ ];
20035
20089
  let match;
20036
20090
  while ((match = variableRegex.exec(text)) !== null) {
20037
20091
  let value = match[2].trim();
20092
+ const isRuntimeValue = runtimePatterns.some((pattern) => pattern.test(value));
20093
+ if (isRuntimeValue) {
20094
+ continue;
20095
+ }
20038
20096
  if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
20039
20097
  value = value.slice(1, -1);
20040
20098
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "norn-cli",
3
3
  "displayName": "Norn - REST Client",
4
4
  "description": "A powerful REST client for making HTTP requests with sequences, variables, scripts, and cookie support",
5
- "version": "1.3.12",
5
+ "version": "1.3.14",
6
6
  "publisher": "Norn-PeterKrustanov",
7
7
  "author": {
8
8
  "name": "Peter Krastanov"