diff --git a/package-lock.json b/package-lock.json index d4524a9..0f35738 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "zzapi", - "version": "1.1.1", + "version": "1.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "zzapi", - "version": "1.1.1", + "version": "1.2.1", "license": "MIT", "dependencies": { "got": "11.8.6", diff --git a/src/runTests.ts b/src/runTests.ts index f1692ac..ee47898 100644 --- a/src/runTests.ts +++ b/src/runTests.ts @@ -12,15 +12,14 @@ export function runAllTests( const results: TestResult[] = []; if (!tests) return results; - let statusFail = false; if (tests.status) { const expected = tests.status; const received = responseData.status; const statusResults = runTest("status", expected, received); results.push(...statusResults); - statusFail = statusResults.some((r) => !r.pass); + + if (stopOnFailure && statusResults.some((r) => !r.pass)) return results; } - if (stopOnFailure && statusFail) return results; for (const spec in tests.headers) { const expected = tests.headers[spec];