From 91d2971cc9db9ef8d8e25101a6cd693ece672419 Mon Sep 17 00:00:00 2001 From: Varun0157 Date: Mon, 3 Jun 2024 01:06:25 +0530 Subject: [PATCH] reformat and feat: added some comments, exporting SpecResult type from module --- src/index.ts | 9 ++++++++- src/runTests.ts | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1302290..422471a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,11 @@ -export { RequestPosition, ResponseData, RequestSpec, GotRequest, TestResult } from "./models"; +export { + RequestPosition, + ResponseData, + RequestSpec, + GotRequest, + TestResult, + SpecResult, +} from "./models"; export { getRequestPositions, getAllRequestSpecs, getRequestSpec } from "./parseBundle"; diff --git a/src/runTests.ts b/src/runTests.ts index 11886a6..6a4bbe4 100644 --- a/src/runTests.ts +++ b/src/runTests.ts @@ -112,7 +112,7 @@ function runObjectTests(opVals: { [key: string]: any }, receivedObject: any, spe try { expected = JSON.parse(expected); - // the spec remains the same + // the spec remains the same, so we add it to the current layer const res = runObjectTests(expected, receivedLen, spec); objRes.results.push(...res.results); objRes.subResults.push(...res.subResults); @@ -161,6 +161,7 @@ function runObjectTests(opVals: { [key: string]: any }, receivedObject: any, spe json: receivedObject, }; + // the spec remains the same, so we add it to the current layer const res = runAllTests(recursiveTests, receivedObj, false, spec); objRes.results.push(...res.results); objRes.subResults.push(...res.subResults);