@thymian/core 0.0.0-PLACEHOLDER
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/README.md +59 -0
- package/dist/actions/action.d.ts +5 -0
- package/dist/actions/action.d.ts.map +1 -0
- package/dist/actions/action.js +2 -0
- package/dist/actions/action.js.map +1 -0
- package/dist/actions/close.action.d.ts +3 -0
- package/dist/actions/close.action.d.ts.map +1 -0
- package/dist/actions/close.action.js +2 -0
- package/dist/actions/close.action.js.map +1 -0
- package/dist/actions/core-analyze.action.d.ts +11 -0
- package/dist/actions/core-analyze.action.d.ts.map +1 -0
- package/dist/actions/core-analyze.action.js +2 -0
- package/dist/actions/core-analyze.action.js.map +1 -0
- package/dist/actions/core-lint.action.d.ts +9 -0
- package/dist/actions/core-lint.action.d.ts.map +1 -0
- package/dist/actions/core-lint.action.js +2 -0
- package/dist/actions/core-lint.action.js.map +1 -0
- package/dist/actions/core-request-sample.action.d.ts +9 -0
- package/dist/actions/core-request-sample.action.d.ts.map +1 -0
- package/dist/actions/core-request-sample.action.js +2 -0
- package/dist/actions/core-request-sample.action.js.map +1 -0
- package/dist/actions/core-test.action.d.ts +10 -0
- package/dist/actions/core-test.action.d.ts.map +1 -0
- package/dist/actions/core-test.action.js +2 -0
- package/dist/actions/core-test.action.js.map +1 -0
- package/dist/actions/core-validation-input.d.ts +6 -0
- package/dist/actions/core-validation-input.d.ts.map +1 -0
- package/dist/actions/core-validation-input.js +2 -0
- package/dist/actions/core-validation-input.js.map +1 -0
- package/dist/actions/format-load.action.d.ts +16 -0
- package/dist/actions/format-load.action.d.ts.map +1 -0
- package/dist/actions/format-load.action.js +36 -0
- package/dist/actions/format-load.action.js.map +1 -0
- package/dist/actions/format.action.d.ts +4 -0
- package/dist/actions/format.action.d.ts.map +1 -0
- package/dist/actions/format.action.js +2 -0
- package/dist/actions/format.action.js.map +1 -0
- package/dist/actions/index.d.ts +39 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +14 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/ready.action.d.ts +3 -0
- package/dist/actions/ready.action.d.ts.map +1 -0
- package/dist/actions/ready.action.js +2 -0
- package/dist/actions/ready.action.js.map +1 -0
- package/dist/actions/report-flush.action.d.ts +6 -0
- package/dist/actions/report-flush.action.d.ts.map +1 -0
- package/dist/actions/report-flush.action.js +2 -0
- package/dist/actions/report-flush.action.js.map +1 -0
- package/dist/actions/request-dispatch.action.d.ts +13 -0
- package/dist/actions/request-dispatch.action.d.ts.map +1 -0
- package/dist/actions/request-dispatch.action.js +45 -0
- package/dist/actions/request-dispatch.action.js.map +1 -0
- package/dist/actions/traffic-load.action.d.ts +16 -0
- package/dist/actions/traffic-load.action.d.ts.map +1 -0
- package/dist/actions/traffic-load.action.js +36 -0
- package/dist/actions/traffic-load.action.js.map +1 -0
- package/dist/actions/validation-result.d.ts +18 -0
- package/dist/actions/validation-result.d.ts.map +1 -0
- package/dist/actions/validation-result.js +81 -0
- package/dist/actions/validation-result.js.map +1 -0
- package/dist/ajv.d.ts +5 -0
- package/dist/ajv.d.ts.map +1 -0
- package/dist/ajv.js +9 -0
- package/dist/ajv.js.map +1 -0
- package/dist/chalk.d.ts +2 -0
- package/dist/chalk.d.ts.map +1 -0
- package/dist/chalk.js +2 -0
- package/dist/chalk.js.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -0
- package/dist/core-plugin.d.ts +5 -0
- package/dist/core-plugin.d.ts.map +1 -0
- package/dist/core-plugin.js +62 -0
- package/dist/core-plugin.js.map +1 -0
- package/dist/emitter/action-event.d.ts +19 -0
- package/dist/emitter/action-event.d.ts.map +1 -0
- package/dist/emitter/action-event.js +2 -0
- package/dist/emitter/action-event.js.map +1 -0
- package/dist/emitter/error-event.d.ts +13 -0
- package/dist/emitter/error-event.d.ts.map +1 -0
- package/dist/emitter/error-event.js +2 -0
- package/dist/emitter/error-event.js.map +1 -0
- package/dist/emitter/events.d.ts +10 -0
- package/dist/emitter/events.d.ts.map +1 -0
- package/dist/emitter/events.js +2 -0
- package/dist/emitter/events.js.map +1 -0
- package/dist/emitter/index.d.ts +6 -0
- package/dist/emitter/index.d.ts.map +1 -0
- package/dist/emitter/index.js +6 -0
- package/dist/emitter/index.js.map +1 -0
- package/dist/emitter/thymian-emitter.d.ts +61 -0
- package/dist/emitter/thymian-emitter.d.ts.map +1 -0
- package/dist/emitter/thymian-emitter.js +371 -0
- package/dist/emitter/thymian-emitter.js.map +1 -0
- package/dist/emitter/utils.d.ts +8 -0
- package/dist/emitter/utils.d.ts.map +1 -0
- package/dist/emitter/utils.js +16 -0
- package/dist/emitter/utils.js.map +1 -0
- package/dist/events/error.event.d.ts +5 -0
- package/dist/events/error.event.d.ts.map +1 -0
- package/dist/events/error.event.js +49 -0
- package/dist/events/error.event.js.map +1 -0
- package/dist/events/exit.event.d.ts +14 -0
- package/dist/events/exit.event.d.ts.map +1 -0
- package/dist/events/exit.event.js +9 -0
- package/dist/events/exit.event.js.map +1 -0
- package/dist/events/index.d.ts +15 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +4 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/register-plugin.event.d.ts +51 -0
- package/dist/events/register-plugin.event.d.ts.map +1 -0
- package/dist/events/register-plugin.event.js +29 -0
- package/dist/events/register-plugin.event.js.map +1 -0
- package/dist/events/report.event.d.ts +104 -0
- package/dist/events/report.event.d.ts.map +1 -0
- package/dist/events/report.event.js +109 -0
- package/dist/events/report.event.js.map +1 -0
- package/dist/format/circular-references.d.ts +3 -0
- package/dist/format/circular-references.d.ts.map +1 -0
- package/dist/format/circular-references.js +71 -0
- package/dist/format/circular-references.js.map +1 -0
- package/dist/format/edges/edge.d.ts +9 -0
- package/dist/format/edges/edge.d.ts.map +1 -0
- package/dist/format/edges/edge.js +2 -0
- package/dist/format/edges/edge.js.map +1 -0
- package/dist/format/edges/has-sample.edge.d.ts +5 -0
- package/dist/format/edges/has-sample.edge.d.ts.map +1 -0
- package/dist/format/edges/has-sample.edge.js +2 -0
- package/dist/format/edges/has-sample.edge.js.map +1 -0
- package/dist/format/edges/http-link.edge.d.ts +10 -0
- package/dist/format/edges/http-link.edge.d.ts.map +1 -0
- package/dist/format/edges/http-link.edge.js +2 -0
- package/dist/format/edges/http-link.edge.js.map +1 -0
- package/dist/format/edges/http-transaction.edge.d.ts +5 -0
- package/dist/format/edges/http-transaction.edge.d.ts.map +1 -0
- package/dist/format/edges/http-transaction.edge.js +2 -0
- package/dist/format/edges/http-transaction.edge.js.map +1 -0
- package/dist/format/edges/is-secured-with.edge.d.ts +5 -0
- package/dist/format/edges/is-secured-with.edge.d.ts.map +1 -0
- package/dist/format/edges/is-secured-with.edge.js +2 -0
- package/dist/format/edges/is-secured-with.edge.js.map +1 -0
- package/dist/format/edges/sample-http-transaction.edge.d.ts +5 -0
- package/dist/format/edges/sample-http-transaction.edge.d.ts.map +1 -0
- package/dist/format/edges/sample-http-transaction.edge.js +2 -0
- package/dist/format/edges/sample-http-transaction.edge.js.map +1 -0
- package/dist/format/format-location.d.ts +13 -0
- package/dist/format/format-location.d.ts.map +1 -0
- package/dist/format/format-location.js +2 -0
- package/dist/format/format-location.js.map +1 -0
- package/dist/format/http-filter-expression-to-transaction-filter.d.ts +5 -0
- package/dist/format/http-filter-expression-to-transaction-filter.d.ts.map +1 -0
- package/dist/format/http-filter-expression-to-transaction-filter.js +88 -0
- package/dist/format/http-filter-expression-to-transaction-filter.js.map +1 -0
- package/dist/format/index.d.ts +14 -0
- package/dist/format/index.d.ts.map +1 -0
- package/dist/format/index.js +14 -0
- package/dist/format/index.js.map +1 -0
- package/dist/format/nodes/http-request.node.d.ts +29 -0
- package/dist/format/nodes/http-request.node.d.ts.map +1 -0
- package/dist/format/nodes/http-request.node.js +2 -0
- package/dist/format/nodes/http-request.node.js.map +1 -0
- package/dist/format/nodes/http-response.node.d.ts +12 -0
- package/dist/format/nodes/http-response.node.d.ts.map +1 -0
- package/dist/format/nodes/http-response.node.js +2 -0
- package/dist/format/nodes/http-response.node.js.map +1 -0
- package/dist/format/nodes/node.d.ts +9 -0
- package/dist/format/nodes/node.d.ts.map +1 -0
- package/dist/format/nodes/node.js +2 -0
- package/dist/format/nodes/node.js.map +1 -0
- package/dist/format/nodes/sample-http-request.node.d.ts +7 -0
- package/dist/format/nodes/sample-http-request.node.d.ts.map +1 -0
- package/dist/format/nodes/sample-http-request.node.js +2 -0
- package/dist/format/nodes/sample-http-request.node.js.map +1 -0
- package/dist/format/nodes/sample-http-response.node.d.ts +7 -0
- package/dist/format/nodes/sample-http-response.node.d.ts.map +1 -0
- package/dist/format/nodes/sample-http-response.node.js +2 -0
- package/dist/format/nodes/sample-http-response.node.js.map +1 -0
- package/dist/format/nodes/security-scheme.node.d.ts +17 -0
- package/dist/format/nodes/security-scheme.node.d.ts.map +1 -0
- package/dist/format/nodes/security-scheme.node.js +2 -0
- package/dist/format/nodes/security-scheme.node.js.map +1 -0
- package/dist/format/parameter.d.ts +10 -0
- package/dist/format/parameter.d.ts.map +1 -0
- package/dist/format/parameter.js +2 -0
- package/dist/format/parameter.js.map +1 -0
- package/dist/format/serialization-style/cookie.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/cookie.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/cookie.serialization-style.js +7 -0
- package/dist/format/serialization-style/cookie.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/header.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/header.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/header.serialization-style.js +7 -0
- package/dist/format/serialization-style/header.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/index.d.ts +6 -0
- package/dist/format/serialization-style/index.d.ts.map +1 -0
- package/dist/format/serialization-style/index.js +6 -0
- package/dist/format/serialization-style/index.js.map +1 -0
- package/dist/format/serialization-style/path.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/path.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/path.serialization-style.js +7 -0
- package/dist/format/serialization-style/path.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/query.serialization-style.d.ts +5 -0
- package/dist/format/serialization-style/query.serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/query.serialization-style.js +7 -0
- package/dist/format/serialization-style/query.serialization-style.js.map +1 -0
- package/dist/format/serialization-style/serialization-style.d.ts +13 -0
- package/dist/format/serialization-style/serialization-style.d.ts.map +1 -0
- package/dist/format/serialization-style/serialization-style.js +25 -0
- package/dist/format/serialization-style/serialization-style.js.map +1 -0
- package/dist/format/thymian-format.d.ts +109 -0
- package/dist/format/thymian-format.d.ts.map +1 -0
- package/dist/format/thymian-format.js +437 -0
- package/dist/format/thymian-format.js.map +1 -0
- package/dist/format/thymian-schema.d.ts +56 -0
- package/dist/format/thymian-schema.d.ts.map +1 -0
- package/dist/format/thymian-schema.js +2 -0
- package/dist/format/thymian-schema.js.map +1 -0
- package/dist/format/utils.d.ts +12 -0
- package/dist/format/utils.d.ts.map +1 -0
- package/dist/format/utils.js +85 -0
- package/dist/format/utils.js.map +1 -0
- package/dist/http-filter-visitor.d.ts +76 -0
- package/dist/http-filter-visitor.d.ts.map +1 -0
- package/dist/http-filter-visitor.js +168 -0
- package/dist/http-filter-visitor.js.map +1 -0
- package/dist/http-filter.d.ts +140 -0
- package/dist/http-filter.d.ts.map +1 -0
- package/dist/http-filter.js +137 -0
- package/dist/http-filter.js.map +1 -0
- package/dist/http-status-codes/1xx/index.d.ts +15 -0
- package/dist/http-status-codes/1xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/1xx/index.js +15 -0
- package/dist/http-status-codes/1xx/index.js.map +1 -0
- package/dist/http-status-codes/1xx/informational.phrases.d.ts +4 -0
- package/dist/http-status-codes/1xx/informational.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/1xx/informational.phrases.js +10 -0
- package/dist/http-status-codes/1xx/informational.phrases.js.map +1 -0
- package/dist/http-status-codes/1xx/informational.status-codes.d.ts +4 -0
- package/dist/http-status-codes/1xx/informational.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/1xx/informational.status-codes.js +5 -0
- package/dist/http-status-codes/1xx/informational.status-codes.js.map +1 -0
- package/dist/http-status-codes/2xx/index.d.ts +25 -0
- package/dist/http-status-codes/2xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/2xx/index.js +25 -0
- package/dist/http-status-codes/2xx/index.js.map +1 -0
- package/dist/http-status-codes/2xx/successful.phrases.d.ts +4 -0
- package/dist/http-status-codes/2xx/successful.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/2xx/successful.phrases.js +15 -0
- package/dist/http-status-codes/2xx/successful.phrases.js.map +1 -0
- package/dist/http-status-codes/2xx/successful.status-codes.d.ts +4 -0
- package/dist/http-status-codes/2xx/successful.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/2xx/successful.status-codes.js +7 -0
- package/dist/http-status-codes/2xx/successful.status-codes.js.map +1 -0
- package/dist/http-status-codes/3xx/index.d.ts +21 -0
- package/dist/http-status-codes/3xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/3xx/index.js +21 -0
- package/dist/http-status-codes/3xx/index.js.map +1 -0
- package/dist/http-status-codes/3xx/redirection.phrases.d.ts +4 -0
- package/dist/http-status-codes/3xx/redirection.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/3xx/redirection.phrases.js +13 -0
- package/dist/http-status-codes/3xx/redirection.phrases.js.map +1 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.d.ts +4 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.js +7 -0
- package/dist/http-status-codes/3xx/redirection.status-codes.js.map +1 -0
- package/dist/http-status-codes/4xx/client-error.phrases.d.ts +4 -0
- package/dist/http-status-codes/4xx/client-error.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/4xx/client-error.phrases.js +34 -0
- package/dist/http-status-codes/4xx/client-error.phrases.js.map +1 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.d.ts +4 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.js +8 -0
- package/dist/http-status-codes/4xx/client-error.status-codes.js.map +1 -0
- package/dist/http-status-codes/4xx/index.d.ts +63 -0
- package/dist/http-status-codes/4xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/4xx/index.js +63 -0
- package/dist/http-status-codes/4xx/index.js.map +1 -0
- package/dist/http-status-codes/5xx/index.d.ts +29 -0
- package/dist/http-status-codes/5xx/index.d.ts.map +1 -0
- package/dist/http-status-codes/5xx/index.js +29 -0
- package/dist/http-status-codes/5xx/index.js.map +1 -0
- package/dist/http-status-codes/5xx/server-error.phrases.d.ts +4 -0
- package/dist/http-status-codes/5xx/server-error.phrases.d.ts.map +1 -0
- package/dist/http-status-codes/5xx/server-error.phrases.js +17 -0
- package/dist/http-status-codes/5xx/server-error.phrases.js.map +1 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.d.ts +4 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.d.ts.map +1 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.js +7 -0
- package/dist/http-status-codes/5xx/server-error.status-codes.js.map +1 -0
- package/dist/http-status-codes/http-status-code-ranges.d.ts +11 -0
- package/dist/http-status-codes/http-status-code-ranges.d.ts.map +1 -0
- package/dist/http-status-codes/http-status-code-ranges.js +19 -0
- package/dist/http-status-codes/http-status-code-ranges.js.map +1 -0
- package/dist/http-status-codes/http-status-code.d.ts +8 -0
- package/dist/http-status-codes/http-status-code.d.ts.map +1 -0
- package/dist/http-status-codes/http-status-code.js +13 -0
- package/dist/http-status-codes/http-status-code.js.map +1 -0
- package/dist/http-status-codes/http-status-phrase.d.ts +8 -0
- package/dist/http-status-codes/http-status-phrase.d.ts.map +1 -0
- package/dist/http-status-codes/http-status-phrase.js +13 -0
- package/dist/http-status-codes/http-status-phrase.js.map +1 -0
- package/dist/http-status-codes/index.d.ts +10 -0
- package/dist/http-status-codes/index.d.ts.map +1 -0
- package/dist/http-status-codes/index.js +10 -0
- package/dist/http-status-codes/index.js.map +1 -0
- package/dist/http-status-codes/phrase-to-status-code.d.ts +62 -0
- package/dist/http-status-codes/phrase-to-status-code.d.ts.map +1 -0
- package/dist/http-status-codes/phrase-to-status-code.js +13 -0
- package/dist/http-status-codes/phrase-to-status-code.js.map +1 -0
- package/dist/http-status-codes/status-code-to-phrase.d.ts +62 -0
- package/dist/http-status-codes/status-code-to-phrase.d.ts.map +1 -0
- package/dist/http-status-codes/status-code-to-phrase.js +13 -0
- package/dist/http-status-codes/status-code-to-phrase.js.map +1 -0
- package/dist/http-status-codes/validate.d.ts +5 -0
- package/dist/http-status-codes/validate.d.ts.map +1 -0
- package/dist/http-status-codes/validate.js +28 -0
- package/dist/http-status-codes/validate.js.map +1 -0
- package/dist/http-testing/http-test/create-hook-runner.d.ts +21 -0
- package/dist/http-testing/http-test/create-hook-runner.d.ts.map +1 -0
- package/dist/http-testing/http-test/create-hook-runner.js +17 -0
- package/dist/http-testing/http-test/create-hook-runner.js.map +1 -0
- package/dist/http-testing/http-test/create-http-test-context.d.ts +3 -0
- package/dist/http-testing/http-test/create-http-test-context.d.ts.map +1 -0
- package/dist/http-testing/http-test/create-http-test-context.js +24 -0
- package/dist/http-testing/http-test/create-http-test-context.js.map +1 -0
- package/dist/http-testing/http-test/http-test-case-result.d.ts +46 -0
- package/dist/http-testing/http-test/http-test-case-result.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-case-result.js +2 -0
- package/dist/http-testing/http-test/http-test-case-result.js.map +1 -0
- package/dist/http-testing/http-test/http-test-case.d.ts +36 -0
- package/dist/http-testing/http-test/http-test-case.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-case.js +2 -0
- package/dist/http-testing/http-test/http-test-case.js.map +1 -0
- package/dist/http-testing/http-test/http-test-context.d.ts +20 -0
- package/dist/http-testing/http-test/http-test-context.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-context.js +2 -0
- package/dist/http-testing/http-test/http-test-context.js.map +1 -0
- package/dist/http-testing/http-test/http-test-hooks.d.ts +26 -0
- package/dist/http-testing/http-test/http-test-hooks.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-hooks.js +2 -0
- package/dist/http-testing/http-test/http-test-hooks.js.map +1 -0
- package/dist/http-testing/http-test/http-test-pipeline.d.ts +10 -0
- package/dist/http-testing/http-test/http-test-pipeline.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test-pipeline.js +2 -0
- package/dist/http-testing/http-test/http-test-pipeline.js.map +1 -0
- package/dist/http-testing/http-test/http-test.d.ts +11 -0
- package/dist/http-testing/http-test/http-test.d.ts.map +1 -0
- package/dist/http-testing/http-test/http-test.js +35 -0
- package/dist/http-testing/http-test/http-test.js.map +1 -0
- package/dist/http-testing/http-test/index.d.ts +10 -0
- package/dist/http-testing/http-test/index.d.ts.map +1 -0
- package/dist/http-testing/http-test/index.js +10 -0
- package/dist/http-testing/http-test/index.js.map +1 -0
- package/dist/http-testing/http-test/utils.d.ts +11 -0
- package/dist/http-testing/http-test/utils.d.ts.map +1 -0
- package/dist/http-testing/http-test/utils.js +16 -0
- package/dist/http-testing/http-test/utils.js.map +1 -0
- package/dist/http-testing/index.d.ts +7 -0
- package/dist/http-testing/index.d.ts.map +1 -0
- package/dist/http-testing/index.js +7 -0
- package/dist/http-testing/index.js.map +1 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.d.ts +5 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.js +39 -0
- package/dist/http-testing/operators/expect-for-transaction.operator.js.map +1 -0
- package/dist/http-testing/operators/expect-headers.operator.d.ts +4 -0
- package/dist/http-testing/operators/expect-headers.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect-headers.operator.js +37 -0
- package/dist/http-testing/operators/expect-headers.operator.js.map +1 -0
- package/dist/http-testing/operators/expect-status-code.operator.d.ts +5 -0
- package/dist/http-testing/operators/expect-status-code.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect-status-code.operator.js +55 -0
- package/dist/http-testing/operators/expect-status-code.operator.js.map +1 -0
- package/dist/http-testing/operators/expect.operator.d.ts +4 -0
- package/dist/http-testing/operators/expect.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/expect.operator.js +31 -0
- package/dist/http-testing/operators/expect.operator.js.map +1 -0
- package/dist/http-testing/operators/fail.operator.d.ts +4 -0
- package/dist/http-testing/operators/fail.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/fail.operator.js +8 -0
- package/dist/http-testing/operators/fail.operator.js.map +1 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.d.ts +10 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.js +18 -0
- package/dist/http-testing/operators/filter-http-transactions.operator.js.map +1 -0
- package/dist/http-testing/operators/generate-requests.operator.d.ts +10 -0
- package/dist/http-testing/operators/generate-requests.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/generate-requests.operator.js +44 -0
- package/dist/http-testing/operators/generate-requests.operator.js.map +1 -0
- package/dist/http-testing/operators/index.d.ts +21 -0
- package/dist/http-testing/operators/index.d.ts.map +1 -0
- package/dist/http-testing/operators/index.js +21 -0
- package/dist/http-testing/operators/index.js.map +1 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.d.ts +7 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.js +32 -0
- package/dist/http-testing/operators/map-to-grouped-test-case.operator.js.map +1 -0
- package/dist/http-testing/operators/map-to-test-case.operator.d.ts +7 -0
- package/dist/http-testing/operators/map-to-test-case.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/map-to-test-case.operator.js +21 -0
- package/dist/http-testing/operators/map-to-test-case.operator.js.map +1 -0
- package/dist/http-testing/operators/override-headers.operator.d.ts +5 -0
- package/dist/http-testing/operators/override-headers.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/override-headers.operator.js +18 -0
- package/dist/http-testing/operators/override-headers.operator.js.map +1 -0
- package/dist/http-testing/operators/override-with-previous.operator.d.ts +5 -0
- package/dist/http-testing/operators/override-with-previous.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/override-with-previous.operator.js +23 -0
- package/dist/http-testing/operators/override-with-previous.operator.js.map +1 -0
- package/dist/http-testing/operators/replay-previous-step.operator.d.ts +5 -0
- package/dist/http-testing/operators/replay-previous-step.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/replay-previous-step.operator.js +27 -0
- package/dist/http-testing/operators/replay-previous-step.operator.js.map +1 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.d.ts +7 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.js +61 -0
- package/dist/http-testing/operators/reply-previous-but-expect-response.operator.js.map +1 -0
- package/dist/http-testing/operators/requires-authorization.operator.d.ts +5 -0
- package/dist/http-testing/operators/requires-authorization.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/requires-authorization.operator.js +9 -0
- package/dist/http-testing/operators/requires-authorization.operator.js.map +1 -0
- package/dist/http-testing/operators/run-requests.operator.d.ts +14 -0
- package/dist/http-testing/operators/run-requests.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/run-requests.operator.js +139 -0
- package/dist/http-testing/operators/run-requests.operator.js.map +1 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.d.ts +5 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.js +43 -0
- package/dist/http-testing/operators/single-step-for-transaction.operator.js.map +1 -0
- package/dist/http-testing/operators/skip.operator.d.ts +5 -0
- package/dist/http-testing/operators/skip.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/skip.operator.js +11 -0
- package/dist/http-testing/operators/skip.operator.js.map +1 -0
- package/dist/http-testing/operators/step.operator.d.ts +5 -0
- package/dist/http-testing/operators/step.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/step.operator.js +20 -0
- package/dist/http-testing/operators/step.operator.js.map +1 -0
- package/dist/http-testing/operators/utils.d.ts +10 -0
- package/dist/http-testing/operators/utils.d.ts.map +1 -0
- package/dist/http-testing/operators/utils.js +17 -0
- package/dist/http-testing/operators/utils.js.map +1 -0
- package/dist/http-testing/operators/validate-responses.operator.d.ts +4 -0
- package/dist/http-testing/operators/validate-responses.operator.d.ts.map +1 -0
- package/dist/http-testing/operators/validate-responses.operator.js +33 -0
- package/dist/http-testing/operators/validate-responses.operator.js.map +1 -0
- package/dist/http-testing/serialize-parameter.d.ts +6 -0
- package/dist/http-testing/serialize-parameter.d.ts.map +1 -0
- package/dist/http-testing/serialize-parameter.js +51 -0
- package/dist/http-testing/serialize-parameter.js.map +1 -0
- package/dist/http-testing/serialize-request.d.ts +7 -0
- package/dist/http-testing/serialize-request.d.ts.map +1 -0
- package/dist/http-testing/serialize-request.js +112 -0
- package/dist/http-testing/serialize-request.js.map +1 -0
- package/dist/http-testing/test-builder/builder-pipeline.d.ts +4 -0
- package/dist/http-testing/test-builder/builder-pipeline.d.ts.map +1 -0
- package/dist/http-testing/test-builder/builder-pipeline.js +2 -0
- package/dist/http-testing/test-builder/builder-pipeline.js.map +1 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.d.ts +9 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.d.ts.map +1 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.js +114 -0
- package/dist/http-testing/test-builder/compilers/http-filter-to-transaction-filter.js.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.d.ts +4 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.d.ts.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.js +36 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-response-checker.js.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts +4 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.d.ts.map +1 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.js +65 -0
- package/dist/http-testing/test-builder/compilers/response-scoped-to-transaction-validator.js.map +1 -0
- package/dist/http-testing/test-builder/extract-value-from-response.d.ts +4 -0
- package/dist/http-testing/test-builder/extract-value-from-response.d.ts.map +1 -0
- package/dist/http-testing/test-builder/extract-value-from-response.js +16 -0
- package/dist/http-testing/test-builder/extract-value-from-response.js.map +1 -0
- package/dist/http-testing/test-builder/override-request-template.d.ts +4 -0
- package/dist/http-testing/test-builder/override-request-template.d.ts.map +1 -0
- package/dist/http-testing/test-builder/override-request-template.js +33 -0
- package/dist/http-testing/test-builder/override-request-template.js.map +1 -0
- package/dist/http-testing/test-builder/reply-step-builder.d.ts +10 -0
- package/dist/http-testing/test-builder/reply-step-builder.d.ts.map +1 -0
- package/dist/http-testing/test-builder/reply-step-builder.js +39 -0
- package/dist/http-testing/test-builder/reply-step-builder.js.map +1 -0
- package/dist/http-testing/test-builder/single-step-test-builder.d.ts +42 -0
- package/dist/http-testing/test-builder/single-step-test-builder.d.ts.map +1 -0
- package/dist/http-testing/test-builder/single-step-test-builder.js +112 -0
- package/dist/http-testing/test-builder/single-step-test-builder.js.map +1 -0
- package/dist/http-testing/validate/ajv.d.ts +3 -0
- package/dist/http-testing/validate/ajv.d.ts.map +1 -0
- package/dist/http-testing/validate/ajv.js +7 -0
- package/dist/http-testing/validate/ajv.js.map +1 -0
- package/dist/http-testing/validate/index.d.ts +9 -0
- package/dist/http-testing/validate/index.d.ts.map +1 -0
- package/dist/http-testing/validate/index.js +9 -0
- package/dist/http-testing/validate/index.js.map +1 -0
- package/dist/http-testing/validate/validate-body.d.ts +5 -0
- package/dist/http-testing/validate/validate-body.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-body.js +62 -0
- package/dist/http-testing/validate/validate-body.js.map +1 -0
- package/dist/http-testing/validate/validate-headers.d.ts +8 -0
- package/dist/http-testing/validate/validate-headers.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-headers.js +101 -0
- package/dist/http-testing/validate/validate-headers.js.map +1 -0
- package/dist/http-testing/validate/validate-request-body.d.ts +5 -0
- package/dist/http-testing/validate/validate-request-body.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-body.js +71 -0
- package/dist/http-testing/validate/validate-request-body.js.map +1 -0
- package/dist/http-testing/validate/validate-request-headers.d.ts +8 -0
- package/dist/http-testing/validate/validate-request-headers.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-headers.js +93 -0
- package/dist/http-testing/validate/validate-request-headers.js.map +1 -0
- package/dist/http-testing/validate/validate-request-path-parameters.d.ts +6 -0
- package/dist/http-testing/validate/validate-request-path-parameters.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-path-parameters.js +69 -0
- package/dist/http-testing/validate/validate-request-path-parameters.js.map +1 -0
- package/dist/http-testing/validate/validate-request-query-parameters.d.ts +7 -0
- package/dist/http-testing/validate/validate-request-query-parameters.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-request-query-parameters.js +91 -0
- package/dist/http-testing/validate/validate-request-query-parameters.js.map +1 -0
- package/dist/http-testing/validate/validate-response.d.ts +7 -0
- package/dist/http-testing/validate/validate-response.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-response.js +15 -0
- package/dist/http-testing/validate/validate-response.js.map +1 -0
- package/dist/http-testing/validate/validate-status-code.d.ts +3 -0
- package/dist/http-testing/validate/validate-status-code.d.ts.map +1 -0
- package/dist/http-testing/validate/validate-status-code.js +25 -0
- package/dist/http-testing/validate/validate-status-code.js.map +1 -0
- package/dist/http.d.ts +29 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +2 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/log-level.d.ts +5 -0
- package/dist/logger/log-level.d.ts.map +1 -0
- package/dist/logger/log-level.js +24 -0
- package/dist/logger/log-level.js.map +1 -0
- package/dist/logger/logger.d.ts +13 -0
- package/dist/logger/logger.d.ts.map +1 -0
- package/dist/logger/logger.js +2 -0
- package/dist/logger/logger.js.map +1 -0
- package/dist/logger/noop.logger.d.ts +15 -0
- package/dist/logger/noop.logger.d.ts.map +1 -0
- package/dist/logger/noop.logger.js +18 -0
- package/dist/logger/noop.logger.js.map +1 -0
- package/dist/logger/text.logger.d.ts +16 -0
- package/dist/logger/text.logger.d.ts.map +1 -0
- package/dist/logger/text.logger.js +51 -0
- package/dist/logger/text.logger.js.map +1 -0
- package/dist/report-sorter.d.ts +16 -0
- package/dist/report-sorter.d.ts.map +1 -0
- package/dist/report-sorter.js +193 -0
- package/dist/report-sorter.js.map +1 -0
- package/dist/rules/ajv-validate.d.ts +2 -0
- package/dist/rules/ajv-validate.d.ts.map +1 -0
- package/dist/rules/ajv-validate.js +4 -0
- package/dist/rules/ajv-validate.js.map +1 -0
- package/dist/rules/captured-trace-to-string.d.ts +3 -0
- package/dist/rules/captured-trace-to-string.d.ts.map +1 -0
- package/dist/rules/captured-trace-to-string.js +27 -0
- package/dist/rules/captured-trace-to-string.js.map +1 -0
- package/dist/rules/common-http-converters.d.ts +8 -0
- package/dist/rules/common-http-converters.d.ts.map +1 -0
- package/dist/rules/common-http-converters.js +58 -0
- package/dist/rules/common-http-converters.js.map +1 -0
- package/dist/rules/contexts.d.ts +63 -0
- package/dist/rules/contexts.d.ts.map +1 -0
- package/dist/rules/contexts.js +2 -0
- package/dist/rules/contexts.js.map +1 -0
- package/dist/rules/index.d.ts +16 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +16 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/rule-builder.d.ts +34 -0
- package/dist/rules/rule-builder.d.ts.map +1 -0
- package/dist/rules/rule-builder.js +112 -0
- package/dist/rules/rule-builder.js.map +1 -0
- package/dist/rules/rule-configuration.d.ts +10 -0
- package/dist/rules/rule-configuration.d.ts.map +1 -0
- package/dist/rules/rule-configuration.js +2 -0
- package/dist/rules/rule-configuration.js.map +1 -0
- package/dist/rules/rule-filter.d.ts +9 -0
- package/dist/rules/rule-filter.d.ts.map +1 -0
- package/dist/rules/rule-filter.js +12 -0
- package/dist/rules/rule-filter.js.map +1 -0
- package/dist/rules/rule-fn.d.ts +7 -0
- package/dist/rules/rule-fn.d.ts.map +1 -0
- package/dist/rules/rule-fn.js +2 -0
- package/dist/rules/rule-fn.js.map +1 -0
- package/dist/rules/rule-loader.d.ts +8 -0
- package/dist/rules/rule-loader.d.ts.map +1 -0
- package/dist/rules/rule-loader.js +124 -0
- package/dist/rules/rule-loader.js.map +1 -0
- package/dist/rules/rule-meta.d.ts +20 -0
- package/dist/rules/rule-meta.d.ts.map +1 -0
- package/dist/rules/rule-meta.js +18 -0
- package/dist/rules/rule-meta.js.map +1 -0
- package/dist/rules/rule-runner.d.ts +30 -0
- package/dist/rules/rule-runner.d.ts.map +1 -0
- package/dist/rules/rule-runner.js +129 -0
- package/dist/rules/rule-runner.js.map +1 -0
- package/dist/rules/rule-set.d.ts +9 -0
- package/dist/rules/rule-set.d.ts.map +1 -0
- package/dist/rules/rule-set.js +2 -0
- package/dist/rules/rule-set.js.map +1 -0
- package/dist/rules/rule-severity.d.ts +10 -0
- package/dist/rules/rule-severity.d.ts.map +1 -0
- package/dist/rules/rule-severity.js +12 -0
- package/dist/rules/rule-severity.js.map +1 -0
- package/dist/rules/rule-violation.d.ts +22 -0
- package/dist/rules/rule-violation.d.ts.map +1 -0
- package/dist/rules/rule-violation.js +2 -0
- package/dist/rules/rule-violation.js.map +1 -0
- package/dist/rules/rule.d.ts +10 -0
- package/dist/rules/rule.d.ts.map +1 -0
- package/dist/rules/rule.js +2 -0
- package/dist/rules/rule.js.map +1 -0
- package/dist/rules/traffic.d.ts +25 -0
- package/dist/rules/traffic.d.ts.map +1 -0
- package/dist/rules/traffic.js +2 -0
- package/dist/rules/traffic.js.map +1 -0
- package/dist/thymian-plugin.d.ts +38 -0
- package/dist/thymian-plugin.d.ts.map +1 -0
- package/dist/thymian-plugin.js +24 -0
- package/dist/thymian-plugin.js.map +1 -0
- package/dist/thymian.d.ts +85 -0
- package/dist/thymian.d.ts.map +1 -0
- package/dist/thymian.error.d.ts +26 -0
- package/dist/thymian.error.d.ts.map +1 -0
- package/dist/thymian.error.js +34 -0
- package/dist/thymian.error.js.map +1 -0
- package/dist/thymian.js +322 -0
- package/dist/thymian.js.map +1 -0
- package/dist/utils.d.ts +40 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +139 -0
- package/dist/utils.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { from } from 'rxjs';
|
|
2
|
+
import {} from '../../index.js';
|
|
3
|
+
import {} from './http-test-case.js';
|
|
4
|
+
export function httpTest(name, fn) {
|
|
5
|
+
return (ctx) => {
|
|
6
|
+
const start = performance.now();
|
|
7
|
+
const testCases = [];
|
|
8
|
+
const transactions = ctx.format.getThymianHttpTransactions();
|
|
9
|
+
const items = transactions.map((transaction) => ({
|
|
10
|
+
current: transaction,
|
|
11
|
+
ctx,
|
|
12
|
+
}));
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
fn(from(items)).subscribe({
|
|
15
|
+
next: (e) => {
|
|
16
|
+
e.current.status =
|
|
17
|
+
e.current.status === 'running' ? 'passed' : e.current.status;
|
|
18
|
+
e.current.end ??= performance.now();
|
|
19
|
+
testCases.push(e.current);
|
|
20
|
+
},
|
|
21
|
+
complete: () => {
|
|
22
|
+
resolve({
|
|
23
|
+
name,
|
|
24
|
+
cases: testCases,
|
|
25
|
+
duration: performance.now() - start,
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
error: (err) => {
|
|
29
|
+
reject(err);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=http-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-test.js","sourceRoot":"","sources":["../../../src/http-testing/http-test/http-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAA+B,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAqB,MAAM,qBAAqB,CAAC;AAiBxD,MAAM,UAAU,QAAQ,CAEtB,IAAY,EAAE,EAA4B;IAC1C,OAAO,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,SAAS,GAAmB,EAAE,CAAC;QAErC,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;QAC7D,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAE5B,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YAClB,OAAO,EAAE,WAAW;YACpB,GAAG;SACJ,CAAC,CAAC,CAAC;QAEJ,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;gBACxB,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE;oBACV,CAAC,CAAC,OAAO,CAAC,MAAM;wBACd,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;oBAC/D,CAAC,CAAC,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,EAAE,CAAC;oBAEpC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC5B,CAAC;gBACD,QAAQ,EAAE,GAAG,EAAE;oBACb,OAAO,CAAC;wBACN,IAAI;wBACJ,KAAK,EAAE,SAAS;wBAChB,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK;qBACpC,CAAC,CAAC;gBACL,CAAC;gBACD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;oBACb,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,CAAC;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './create-hook-runner.js';
|
|
2
|
+
export * from './create-http-test-context.js';
|
|
3
|
+
export * from './http-test.js';
|
|
4
|
+
export * from './http-test-case.js';
|
|
5
|
+
export * from './http-test-case-result.js';
|
|
6
|
+
export * from './http-test-context.js';
|
|
7
|
+
export * from './http-test-hooks.js';
|
|
8
|
+
export * from './http-test-pipeline.js';
|
|
9
|
+
export * from './utils.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/http-testing/http-test/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './create-hook-runner.js';
|
|
2
|
+
export * from './create-http-test-context.js';
|
|
3
|
+
export * from './http-test.js';
|
|
4
|
+
export * from './http-test-case.js';
|
|
5
|
+
export * from './http-test-case-result.js';
|
|
6
|
+
export * from './http-test-context.js';
|
|
7
|
+
export * from './http-test-hooks.js';
|
|
8
|
+
export * from './http-test-pipeline.js';
|
|
9
|
+
export * from './utils.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/http-testing/http-test/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CustomHttpTestCaseStep, GroupedHttpTestCaseStep, HttpTestCase, HttpTestCaseStep, SingleHttpTestCaseStep } from './http-test-case.js';
|
|
2
|
+
export declare function isSingleHttpTestCaseStep(step?: HttpTestCaseStep): step is SingleHttpTestCaseStep;
|
|
3
|
+
export declare function isGroupedHttpTestCaseStep(step?: HttpTestCaseStep): step is GroupedHttpTestCaseStep;
|
|
4
|
+
export declare function isCustomHttpTestCaseStep(step?: HttpTestCaseStep): step is CustomHttpTestCaseStep;
|
|
5
|
+
export declare function isSkippedTestCase<Steps extends HttpTestCaseStep[]>(testCase: HttpTestCase<Steps>): testCase is HttpTestCase<Steps> & {
|
|
6
|
+
status: 'skipped';
|
|
7
|
+
};
|
|
8
|
+
export declare function isFailedTestCase<Steps extends HttpTestCaseStep[]>(testCase: HttpTestCase<Steps>): testCase is HttpTestCase<Steps> & {
|
|
9
|
+
status: 'failed';
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/http-testing/http-test/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,wBAAwB,CACtC,IAAI,CAAC,EAAE,gBAAgB,GACtB,IAAI,IAAI,sBAAsB,CAEhC;AAED,wBAAgB,yBAAyB,CACvC,IAAI,CAAC,EAAE,gBAAgB,GACtB,IAAI,IAAI,uBAAuB,CAEjC;AAED,wBAAgB,wBAAwB,CACtC,IAAI,CAAC,EAAE,gBAAgB,GACtB,IAAI,IAAI,sBAAsB,CAEhC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,gBAAgB,EAAE,EAChE,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,GAC5B,QAAQ,IAAI,YAAY,CAAC,KAAK,CAAC,GAAG;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,CAEzD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,gBAAgB,EAAE,EAC/D,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,GAC5B,QAAQ,IAAI,YAAY,CAAC,KAAK,CAAC,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,CAExD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function isSingleHttpTestCaseStep(step) {
|
|
2
|
+
return step?.type === 'single';
|
|
3
|
+
}
|
|
4
|
+
export function isGroupedHttpTestCaseStep(step) {
|
|
5
|
+
return step?.type === 'grouped';
|
|
6
|
+
}
|
|
7
|
+
export function isCustomHttpTestCaseStep(step) {
|
|
8
|
+
return step?.type === 'custom';
|
|
9
|
+
}
|
|
10
|
+
export function isSkippedTestCase(testCase) {
|
|
11
|
+
return testCase.status === 'skipped';
|
|
12
|
+
}
|
|
13
|
+
export function isFailedTestCase(testCase) {
|
|
14
|
+
return testCase.status === 'failed';
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/http-testing/http-test/utils.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,wBAAwB,CACtC,IAAuB;IAEvB,OAAO,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,IAAuB;IAEvB,OAAO,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,IAAuB;IAEvB,OAAO,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,QAA6B;IAE7B,OAAO,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,QAA6B;IAE7B,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './http-test/index.js';
|
|
2
|
+
export * from './operators/index.js';
|
|
3
|
+
export * from './serialize-parameter.js';
|
|
4
|
+
export * from './serialize-request.js';
|
|
5
|
+
export * from './test-builder/single-step-test-builder.js';
|
|
6
|
+
export * from './validate/index.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http-testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './http-test/index.js';
|
|
2
|
+
export * from './operators/index.js';
|
|
3
|
+
export * from './serialize-parameter.js';
|
|
4
|
+
export * from './serialize-request.js';
|
|
5
|
+
export * from './test-builder/single-step-test-builder.js';
|
|
6
|
+
export * from './validate/index.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http-testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
2
|
+
import { type HttpTestCase, type HttpTestCaseStep, type HttpTestCaseStepTransaction, type PipelineItem } from '../http-test/index.js';
|
|
3
|
+
export type HttpTestCaseTransactionValidationFn = (transaction: HttpTestCaseStepTransaction) => void;
|
|
4
|
+
export declare function expectForTransactions<Steps extends HttpTestCaseStep[]>(fn: HttpTestCaseTransactionValidationFn): MonoTypeOperatorFunction<PipelineItem<HttpTestCase<Steps>>>;
|
|
5
|
+
//# sourceMappingURL=expect-for-transaction.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-for-transaction.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/expect-for-transaction.operator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,EAGhC,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,mCAAmC,GAAG,CAChD,WAAW,EAAE,2BAA2B,KACrC,IAAI,CAAC;AAEV,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,gBAAgB,EAAE,EACpE,EAAE,EAAE,mCAAmC,GACtC,wBAAwB,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAwC7D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AssertionError } from 'node:assert';
|
|
2
|
+
import { map } from 'rxjs';
|
|
3
|
+
import { isFailedTestCase, isSkippedTestCase, } from '../http-test/index.js';
|
|
4
|
+
export function expectForTransactions(fn) {
|
|
5
|
+
return map(({ current, ctx }) => {
|
|
6
|
+
if (isSkippedTestCase(current) || isFailedTestCase(current)) {
|
|
7
|
+
return { current, ctx };
|
|
8
|
+
}
|
|
9
|
+
const step = current.steps.at(-1);
|
|
10
|
+
if (!step) {
|
|
11
|
+
ctx.logger.warn(`Calling "expectForTransaction" for test case "${current.name}" that includes no test case steps.`);
|
|
12
|
+
return { current, ctx };
|
|
13
|
+
}
|
|
14
|
+
for (const transaction of step.transactions) {
|
|
15
|
+
try {
|
|
16
|
+
fn(transaction);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
if (e instanceof AssertionError) {
|
|
20
|
+
current.results.push({
|
|
21
|
+
type: 'assertion-failure',
|
|
22
|
+
message: e.message,
|
|
23
|
+
timestamp: Date.now(),
|
|
24
|
+
assertion: e.operator,
|
|
25
|
+
expected: e.expected,
|
|
26
|
+
actual: e.actual,
|
|
27
|
+
transaction: transaction.source,
|
|
28
|
+
});
|
|
29
|
+
return ctx.fail(current, e.message);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
throw e;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { current, ctx };
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=expect-for-transaction.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-for-transaction.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/expect-for-transaction.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAiC,MAAM,MAAM,CAAC;AAE1D,OAAO,EAIL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,UAAU,qBAAqB,CACnC,EAAuC;IAEvC,OAAO,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QAC9B,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,iDAAiD,OAAO,CAAC,IAAI,qCAAqC,CACnG,CAAC;YAEF,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAC5C,IAAI,CAAC;gBACH,EAAE,CAAC,WAAW,CAAC,CAAC;YAClB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,YAAY,cAAc,EAAE,CAAC;oBAChC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;wBACnB,IAAI,EAAE,mBAAmB;wBACzB,OAAO,EAAE,CAAC,CAAC,OAAO;wBAClB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;wBACrB,SAAS,EAAE,CAAC,CAAC,QAAQ;wBACrB,QAAQ,EAAE,CAAC,CAAC,QAAQ;wBACpB,MAAM,EAAE,CAAC,CAAC,MAAM;wBAChB,WAAW,EAAE,WAAW,CAAC,MAAM;qBAChC,CAAC,CAAC;oBAEH,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;gBACtC,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,CAAC;gBACV,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
2
|
+
import { type HttpTestCase, type HttpTestCaseStep, type HttpTestCaseStepTransaction, type PipelineItem } from '../http-test/index.js';
|
|
3
|
+
export declare function expectHeaders<Steps extends HttpTestCaseStep[]>(fn: (headers: Record<string, string | string[] | undefined>, transaction: HttpTestCaseStepTransaction) => void): MonoTypeOperatorFunction<PipelineItem<HttpTestCase<Steps>>>;
|
|
4
|
+
//# sourceMappingURL=expect-headers.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-headers.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/expect-headers.operator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,EAGhC,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,aAAa,CAAC,KAAK,SAAS,gBAAgB,EAAE,EAC5D,EAAE,EAAE,CACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,EACtD,WAAW,EAAE,2BAA2B,KACrC,IAAI,GACR,wBAAwB,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAiC7D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AssertionError } from 'node:assert';
|
|
2
|
+
import { map } from 'rxjs';
|
|
3
|
+
import { isFailedTestCase, isSkippedTestCase, } from '../http-test/index.js';
|
|
4
|
+
export function expectHeaders(fn) {
|
|
5
|
+
return map(({ current, ctx }) => {
|
|
6
|
+
if (isSkippedTestCase(current) || isFailedTestCase(current)) {
|
|
7
|
+
return { current, ctx };
|
|
8
|
+
}
|
|
9
|
+
for (const step of current.steps) {
|
|
10
|
+
for (const transaction of step.transactions) {
|
|
11
|
+
if (transaction.response?.headers) {
|
|
12
|
+
try {
|
|
13
|
+
fn(transaction.response.headers, transaction);
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
if (e instanceof AssertionError) {
|
|
17
|
+
current.results.push({
|
|
18
|
+
type: 'assertion-failure',
|
|
19
|
+
message: e.message,
|
|
20
|
+
timestamp: Date.now(),
|
|
21
|
+
assertion: e.operator,
|
|
22
|
+
expected: e.expected,
|
|
23
|
+
actual: e.actual,
|
|
24
|
+
});
|
|
25
|
+
return ctx.fail(current, e.message);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
throw e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { current, ctx };
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=expect-headers.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-headers.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/expect-headers.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAiC,MAAM,MAAM,CAAC;AAE1D,OAAO,EAIL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,UAAU,aAAa,CAC3B,EAGS;IAET,OAAO,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QAC9B,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YACjC,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC5C,IAAI,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;oBAClC,IAAI,CAAC;wBACH,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;oBAChD,CAAC;oBAAC,OAAO,CAAC,EAAE,CAAC;wBACX,IAAI,CAAC,YAAY,cAAc,EAAE,CAAC;4BAChC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;gCACnB,IAAI,EAAE,mBAAmB;gCACzB,OAAO,EAAE,CAAC,CAAC,OAAO;gCAClB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gCACrB,SAAS,EAAE,CAAC,CAAC,QAAQ;gCACrB,QAAQ,EAAE,CAAC,CAAC,QAAQ;gCACpB,MAAM,EAAE,CAAC,CAAC,MAAM;6BACjB,CAAC,CAAC;4BAEH,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;wBACtC,CAAC;6BAAM,CAAC;4BACN,MAAM,CAAC,CAAC;wBACV,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
2
|
+
import { type HttpStatusCodeRange } from '../../index.js';
|
|
3
|
+
import { type HttpTestCase, type HttpTestCaseStep, type PipelineItem } from '../http-test/index.js';
|
|
4
|
+
export declare function expectStatusCode<Steps extends HttpTestCaseStep[]>(statusCode: number | HttpStatusCodeRange | (number | HttpStatusCodeRange)[]): MonoTypeOperatorFunction<PipelineItem<HttpTestCase<Steps>>>;
|
|
5
|
+
//# sourceMappingURL=expect-status-code.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-status-code.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/expect-status-code.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAG1D,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAGrB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,gBAAgB,EAAE,EAC/D,UAAU,EAAE,MAAM,GAAG,mBAAmB,GAAG,CAAC,MAAM,GAAG,mBAAmB,CAAC,EAAE,GAC1E,wBAAwB,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CA2D7D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { map } from 'rxjs';
|
|
2
|
+
import { zipArrays } from '../../index.js';
|
|
3
|
+
import { statusCodeMatchesRange, } from '../../index.js';
|
|
4
|
+
import { isFailedTestCase, isSkippedTestCase, } from '../http-test/index.js';
|
|
5
|
+
export function expectStatusCode(statusCode) {
|
|
6
|
+
return map(({ current, ctx }) => {
|
|
7
|
+
if (isSkippedTestCase(current) || isFailedTestCase(current)) {
|
|
8
|
+
return { current, ctx };
|
|
9
|
+
}
|
|
10
|
+
const step = current.steps.at(-1);
|
|
11
|
+
if (step) {
|
|
12
|
+
if (Array.isArray(statusCode)) {
|
|
13
|
+
const transactionsAndCodes = zipArrays(step.transactions, statusCode);
|
|
14
|
+
for (const [transaction, statusCode] of transactionsAndCodes) {
|
|
15
|
+
const isValidStatusCode = typeof statusCode === 'number'
|
|
16
|
+
? (code) => code === statusCode
|
|
17
|
+
: (code) => statusCodeMatchesRange(code, statusCode);
|
|
18
|
+
if (transaction.response &&
|
|
19
|
+
!isValidStatusCode(transaction.response.statusCode)) {
|
|
20
|
+
current.results.push({
|
|
21
|
+
type: 'assertion-failure',
|
|
22
|
+
message: `Expected status code ${statusCode} but got ${transaction.response.statusCode}`,
|
|
23
|
+
timestamp: Date.now(),
|
|
24
|
+
actual: transaction.response.statusCode,
|
|
25
|
+
expected: statusCode,
|
|
26
|
+
assertion: '===',
|
|
27
|
+
});
|
|
28
|
+
current.status = 'failed';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const isValidStatusCode = typeof statusCode === 'number'
|
|
34
|
+
? (code) => code === statusCode
|
|
35
|
+
: (code) => statusCodeMatchesRange(code, statusCode);
|
|
36
|
+
step.transactions.forEach((transaction) => {
|
|
37
|
+
if (transaction.response &&
|
|
38
|
+
!isValidStatusCode(transaction.response.statusCode)) {
|
|
39
|
+
current.results.push({
|
|
40
|
+
type: 'assertion-failure',
|
|
41
|
+
message: `Expected status code ${statusCode} but got ${transaction.response.statusCode}`,
|
|
42
|
+
timestamp: Date.now(),
|
|
43
|
+
actual: transaction.response.statusCode,
|
|
44
|
+
expected: statusCode,
|
|
45
|
+
assertion: '===',
|
|
46
|
+
});
|
|
47
|
+
current.status = 'failed';
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { current, ctx };
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=expect-status-code.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect-status-code.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/expect-status-code.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAiC,MAAM,MAAM,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAEL,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,UAAU,gBAAgB,CAC9B,UAA2E;IAE3E,OAAO,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QAC9B,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC1B,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,MAAM,oBAAoB,GAAG,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBAEtE,KAAK,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,oBAAoB,EAAE,CAAC;oBAC7D,MAAM,iBAAiB,GACrB,OAAO,UAAU,KAAK,QAAQ;wBAC5B,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU;wBACvC,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;oBAEjE,IACE,WAAW,CAAC,QAAQ;wBACpB,CAAC,iBAAiB,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EACnD,CAAC;wBACD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;4BACnB,IAAI,EAAE,mBAAmB;4BACzB,OAAO,EAAE,wBAAwB,UAAU,YAAY,WAAW,CAAC,QAAQ,CAAC,UAAU,EAAE;4BACxF,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;4BACrB,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,UAAU;4BACvC,QAAQ,EAAE,UAAU;4BACpB,SAAS,EAAE,KAAK;yBACjB,CAAC,CAAC;wBACH,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;oBAC5B,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,iBAAiB,GACrB,OAAO,UAAU,KAAK,QAAQ;oBAC5B,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU;oBACvC,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAEjE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;oBACxC,IACE,WAAW,CAAC,QAAQ;wBACpB,CAAC,iBAAiB,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EACnD,CAAC;wBACD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;4BACnB,IAAI,EAAE,mBAAmB;4BACzB,OAAO,EAAE,wBAAwB,UAAU,YAAY,WAAW,CAAC,QAAQ,CAAC,UAAU,EAAE;4BACxF,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;4BACrB,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,UAAU;4BACvC,QAAQ,EAAE,UAAU;4BACpB,SAAS,EAAE,KAAK;yBACjB,CAAC,CAAC;wBACH,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;oBAC5B,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
2
|
+
import { type HttpTestCase, type HttpTestCaseStep, type PipelineItem } from '../http-test/index.js';
|
|
3
|
+
export declare function expect<Steps extends HttpTestCaseStep[]>(fn: (testInstance: PipelineItem<HttpTestCase<Steps>>) => void): MonoTypeOperatorFunction<PipelineItem<HttpTestCase<Steps>>>;
|
|
4
|
+
//# sourceMappingURL=expect.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/expect.operator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAGrB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,MAAM,CAAC,KAAK,SAAS,gBAAgB,EAAE,EACrD,EAAE,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,GAC5D,wBAAwB,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CA2B7D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AssertionError } from 'node:assert';
|
|
2
|
+
import { map } from 'rxjs';
|
|
3
|
+
import { isFailedTestCase, isSkippedTestCase, } from '../http-test/index.js';
|
|
4
|
+
export function expect(fn) {
|
|
5
|
+
return map((item) => {
|
|
6
|
+
if (isSkippedTestCase(item.current) || isFailedTestCase(item.current)) {
|
|
7
|
+
return item;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
fn(item);
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
if (e instanceof AssertionError) {
|
|
14
|
+
item.current.results.push({
|
|
15
|
+
type: 'assertion-failure',
|
|
16
|
+
message: e.message,
|
|
17
|
+
timestamp: Date.now(),
|
|
18
|
+
assertion: e.operator,
|
|
19
|
+
expected: e.expected,
|
|
20
|
+
actual: e.actual,
|
|
21
|
+
});
|
|
22
|
+
return item.ctx.fail(item.current, e.message);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
throw e;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return item;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=expect.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/expect.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,GAAG,EAAiC,MAAM,MAAM,CAAC;AAE1D,OAAO,EAGL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,UAAU,MAAM,CACpB,EAA6D;IAE7D,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClB,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACtE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC;YACH,EAAE,CAAC,IAAI,CAAC,CAAC;QACX,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,cAAc,EAAE,CAAC;gBAChC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;oBACxB,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE,CAAC,CAAC,OAAO;oBAClB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACrB,SAAS,EAAE,CAAC,CAAC,QAAQ;oBACrB,QAAQ,EAAE,CAAC,CAAC,QAAQ;oBACpB,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,CAAC;YACV,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type OperatorFunction } from 'rxjs';
|
|
2
|
+
import type { HttpTestCase, HttpTestCaseStep } from '../http-test/index.js';
|
|
3
|
+
export declare function failTestCase<Steps extends HttpTestCaseStep[]>(fn?: (testCase: HttpTestCase<Steps>) => boolean): OperatorFunction<HttpTestCase<Steps>, HttpTestCase<Steps>>;
|
|
4
|
+
//# sourceMappingURL=fail.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fail.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/fail.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,wBAAgB,YAAY,CAAC,KAAK,SAAS,gBAAgB,EAAE,EAC3D,EAAE,GAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,OAAoB,GAC1D,gBAAgB,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAK5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fail.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/fail.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAyB,MAAM,MAAM,CAAC;AAIlD,MAAM,UAAU,YAAY,CAC1B,KAAiD,GAAG,EAAE,CAAC,IAAI;IAE3D,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACxB,GAAG,QAAQ;QACX,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM;KAClD,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
2
|
+
import { type ThymianHttpRequest, type ThymianHttpResponse, type ThymianHttpTransaction } from '../../index.js';
|
|
3
|
+
import { type StringAndNumberProperties } from '../../utils.js';
|
|
4
|
+
import type { PipelineItem } from '../http-test/index.js';
|
|
5
|
+
export type RequestFilterFn = (req: ThymianHttpRequest, reqId: string, responses: [string, ThymianHttpResponse][]) => boolean;
|
|
6
|
+
export type RequestFilter = StringAndNumberProperties<ThymianHttpRequest> | RequestFilterFn;
|
|
7
|
+
export type ResponseFilterFn = (res: ThymianHttpResponse, resId: string, req: ThymianHttpRequest, reqId: string) => boolean;
|
|
8
|
+
export type ResponseFilter = StringAndNumberProperties<ThymianHttpResponse> | ResponseFilterFn;
|
|
9
|
+
export declare function filterHttpTransactions(reqFilter?: RequestFilter, resFilter?: ResponseFilter): MonoTypeOperatorFunction<PipelineItem<ThymianHttpTransaction>>;
|
|
10
|
+
//# sourceMappingURL=filter-http-transactions.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-http-transactions.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/filter-http-transactions.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAE7D,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,CAC5B,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE,KACvC,OAAO,CAAC;AAEb,MAAM,MAAM,aAAa,GACrB,yBAAyB,CAAC,kBAAkB,CAAC,GAC7C,eAAe,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG,CAC7B,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,KACV,OAAO,CAAC;AAEb,MAAM,MAAM,cAAc,GACtB,yBAAyB,CAAC,mBAAmB,CAAC,GAC9C,gBAAgB,CAAC;AAErB,wBAAgB,sBAAsB,CACpC,SAAS,GAAE,aAAkB,EAC7B,SAAS,GAAE,cAAmB,GAC7B,wBAAwB,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC,CA2BhE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { filter } from 'rxjs';
|
|
2
|
+
import { matchObjects, } from '../../index.js';
|
|
3
|
+
import {} from '../../utils.js';
|
|
4
|
+
export function filterHttpTransactions(reqFilter = {}, resFilter = {}) {
|
|
5
|
+
return filter(({ current: transaction, ctx }) => {
|
|
6
|
+
const requestFilter = typeof reqFilter !== 'function'
|
|
7
|
+
? (t) => matchObjects(t.thymianReq, reqFilter)
|
|
8
|
+
: (t) => {
|
|
9
|
+
const responses = ctx.format.getNeighboursOfType(transaction.thymianReqId, 'http-response');
|
|
10
|
+
return reqFilter(t.thymianReq, t.thymianReqId, responses);
|
|
11
|
+
};
|
|
12
|
+
const responseFilter = typeof resFilter !== 'function'
|
|
13
|
+
? (t) => matchObjects(t.thymianRes, resFilter)
|
|
14
|
+
: (t) => resFilter(t.thymianRes, t.thymianResId, t.thymianReq, t.thymianReqId);
|
|
15
|
+
return requestFilter(transaction) && responseFilter(transaction);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=filter-http-transactions.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-http-transactions.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/filter-http-transactions.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAE7D,OAAO,EACL,YAAY,GAIb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAkC,MAAM,gBAAgB,CAAC;AAwBhE,MAAM,UAAU,sBAAsB,CACpC,YAA2B,EAAE,EAC7B,YAA4B,EAAE;IAE9B,OAAO,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,EAAE;QAC9C,MAAM,aAAa,GACjB,OAAO,SAAS,KAAK,UAAU;YAC7B,CAAC,CAAC,CAAC,CAAyB,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC;YACtE,CAAC,CAAC,CAAC,CAAyB,EAAE,EAAE;gBAC5B,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAC9C,WAAW,CAAC,YAAY,EACxB,eAAe,CAChB,CAAC;gBAEF,OAAO,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;YAC5D,CAAC,CAAC;QAER,MAAM,cAAc,GAClB,OAAO,SAAS,KAAK,UAAU;YAC7B,CAAC,CAAC,CAAC,CAAyB,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC;YACtE,CAAC,CAAC,CAAC,CAAyB,EAAE,EAAE,CAC5B,SAAS,CACP,CAAC,CAAC,UAAU,EACZ,CAAC,CAAC,YAAY,EACd,CAAC,CAAC,UAAU,EACZ,CAAC,CAAC,YAAY,CACf,CAAC;QAEV,OAAO,aAAa,CAAC,WAAW,CAAC,IAAI,cAAc,CAAC,WAAW,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OperatorFunction } from 'rxjs';
|
|
2
|
+
import type { PartialExceptFor } from '../../index.js';
|
|
3
|
+
import { type GenerateRequestsOptions, type HttpTestCase, type HttpTestCaseStep, type HttpTestCaseStepTransaction, type HttpTestContextLocals, type PipelineItem, type SingleHttpTestCaseStep } from '../http-test/index.js';
|
|
4
|
+
type InferStep<Step extends HttpTestCaseStep> = Step extends SingleHttpTestCaseStep<infer Transactions> ? SingleHttpTestCaseStep<[
|
|
5
|
+
...Transactions,
|
|
6
|
+
PartialExceptFor<HttpTestCaseStepTransaction, 'requestTemplate' | 'source'>
|
|
7
|
+
]> : Step;
|
|
8
|
+
export declare function generateRequests<PreviousSteps extends HttpTestCaseStep[], CurrentStep extends HttpTestCaseStep, Locals extends HttpTestContextLocals>(options?: GenerateRequestsOptions): OperatorFunction<PipelineItem<HttpTestCase<[...PreviousSteps, CurrentStep]>, Locals>, PipelineItem<HttpTestCase<[...PreviousSteps, InferStep<CurrentStep>]>, Locals>>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=generate-requests.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-requests.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/generate-requests.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAS/B,KAAK,SAAS,CAAC,IAAI,SAAS,gBAAgB,IAC1C,IAAI,SAAS,sBAAsB,CAAC,MAAM,YAAY,CAAC,GACnD,sBAAsB,CACpB;IACE,GAAG,YAAY;IACf,gBAAgB,CACd,2BAA2B,EAC3B,iBAAiB,GAAG,QAAQ,CAC7B;CACF,CACF,GACD,IAAI,CAAC;AAEX,wBAAgB,gBAAgB,CAC9B,aAAa,SAAS,gBAAgB,EAAE,EACxC,WAAW,SAAS,gBAAgB,EACpC,MAAM,SAAS,qBAAqB,EAEpC,OAAO,CAAC,EAAE,uBAAuB,GAChC,gBAAgB,CACjB,YAAY,CAAC,YAAY,CAAC,CAAC,GAAG,aAAa,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EACnE,YAAY,CAAC,YAAY,CAAC,CAAC,GAAG,aAAa,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAC/E,CAkDA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { mergeMap } from 'rxjs';
|
|
2
|
+
import {} from '../http-test/index.js';
|
|
3
|
+
import { isCustomHttpTestCaseStep, isFailedTestCase, isGroupedHttpTestCaseStep, isSingleHttpTestCaseStep, isSkippedTestCase, } from '../http-test/index.js';
|
|
4
|
+
export function generateRequests(options) {
|
|
5
|
+
return mergeMap(async ({ current, ctx }) => {
|
|
6
|
+
if (isSkippedTestCase(current) || isFailedTestCase(current)) {
|
|
7
|
+
return {
|
|
8
|
+
current: current,
|
|
9
|
+
ctx,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const step = current.steps.at(-1);
|
|
13
|
+
if (isSingleHttpTestCaseStep(step)) {
|
|
14
|
+
const template = await ctx.sampleRequest(step.source);
|
|
15
|
+
if (typeof template === 'undefined') {
|
|
16
|
+
throw new Error('Failed to generate request template for transactions: ' +
|
|
17
|
+
JSON.stringify(step.source));
|
|
18
|
+
}
|
|
19
|
+
step.transactions.push({
|
|
20
|
+
requestTemplate: {
|
|
21
|
+
...template,
|
|
22
|
+
authorize: options?.authenticate ?? template.authorize,
|
|
23
|
+
},
|
|
24
|
+
source: step.source,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else if (isGroupedHttpTestCaseStep(step)) {
|
|
28
|
+
for (const transaction of step.source.transactions) {
|
|
29
|
+
step.transactions.push({
|
|
30
|
+
requestTemplate: await ctx.sampleRequest(transaction),
|
|
31
|
+
source: transaction,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (isCustomHttpTestCaseStep(step)) {
|
|
36
|
+
ctx.logger.warn('generateRequests was called on custom http test step which is not supported.');
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
current: current,
|
|
40
|
+
ctx,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=generate-requests.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-requests.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/generate-requests.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,MAAM,MAAM,CAAC;AAGvD,OAAO,EAQN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAe/B,MAAM,UAAU,gBAAgB,CAK9B,OAAiC;IAKjC,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QACzC,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5D,OAAO;gBACL,OAAO,EAAE,OAER;gBACD,GAAG;aACJ,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAEtD,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CACb,wDAAwD;oBACtD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAC9B,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;gBACrB,eAAe,EAAE;oBACf,GAAG,QAAQ;oBACX,SAAS,EAAE,OAAO,EAAE,YAAY,IAAI,QAAQ,CAAC,SAAS;iBACvD;gBACD,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3C,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;gBACnD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;oBACrB,eAAe,EAAE,MAAM,GAAG,CAAC,aAAa,CAAC,WAAW,CAAC;oBACrD,MAAM,EAAE,WAAW;iBACW,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;aAAM,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,8EAA8E,CAC/E,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,OAER;YACD,GAAG;SACJ,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './expect.operator.js';
|
|
2
|
+
export * from './expect-for-transaction.operator.js';
|
|
3
|
+
export * from './expect-headers.operator.js';
|
|
4
|
+
export * from './expect-status-code.operator.js';
|
|
5
|
+
export * from './fail.operator.js';
|
|
6
|
+
export * from './filter-http-transactions.operator.js';
|
|
7
|
+
export * from './generate-requests.operator.js';
|
|
8
|
+
export * from './map-to-grouped-test-case.operator.js';
|
|
9
|
+
export * from './map-to-test-case.operator.js';
|
|
10
|
+
export * from './override-headers.operator.js';
|
|
11
|
+
export * from './override-with-previous.operator.js';
|
|
12
|
+
export * from './replay-previous-step.operator.js';
|
|
13
|
+
export * from './reply-previous-but-expect-response.operator.js';
|
|
14
|
+
export * from './requires-authorization.operator.js';
|
|
15
|
+
export * from './run-requests.operator.js';
|
|
16
|
+
export * from './single-step-for-transaction.operator.js';
|
|
17
|
+
export * from './skip.operator.js';
|
|
18
|
+
export * from './step.operator.js';
|
|
19
|
+
export * from './utils.js';
|
|
20
|
+
export * from './validate-responses.operator.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './expect.operator.js';
|
|
2
|
+
export * from './expect-for-transaction.operator.js';
|
|
3
|
+
export * from './expect-headers.operator.js';
|
|
4
|
+
export * from './expect-status-code.operator.js';
|
|
5
|
+
export * from './fail.operator.js';
|
|
6
|
+
export * from './filter-http-transactions.operator.js';
|
|
7
|
+
export * from './generate-requests.operator.js';
|
|
8
|
+
export * from './map-to-grouped-test-case.operator.js';
|
|
9
|
+
export * from './map-to-test-case.operator.js';
|
|
10
|
+
export * from './override-headers.operator.js';
|
|
11
|
+
export * from './override-with-previous.operator.js';
|
|
12
|
+
export * from './replay-previous-step.operator.js';
|
|
13
|
+
export * from './reply-previous-but-expect-response.operator.js';
|
|
14
|
+
export * from './requires-authorization.operator.js';
|
|
15
|
+
export * from './run-requests.operator.js';
|
|
16
|
+
export * from './single-step-for-transaction.operator.js';
|
|
17
|
+
export * from './skip.operator.js';
|
|
18
|
+
export * from './step.operator.js';
|
|
19
|
+
export * from './utils.js';
|
|
20
|
+
export * from './validate-responses.operator.js';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/http-testing/operators/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type GroupedObservable, type OperatorFunction } from 'rxjs';
|
|
2
|
+
import { type ThymianHttpTransaction } from '../../index.js';
|
|
3
|
+
import type { GroupedHttpTestCaseStep, HttpTestCase } from '../http-test/http-test-case.js';
|
|
4
|
+
import type { HttpTestContextLocals } from '../http-test/http-test-context.js';
|
|
5
|
+
import type { PipelineItem } from '../http-test/http-test-pipeline.js';
|
|
6
|
+
export declare function mapToGroupedTestCase<Locals extends HttpTestContextLocals>(): OperatorFunction<GroupedObservable<string, PipelineItem<ThymianHttpTransaction, Locals>>, PipelineItem<HttpTestCase<[GroupedHttpTestCaseStep]>, Locals>>;
|
|
7
|
+
//# sourceMappingURL=map-to-grouped-test-case.operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-to-grouped-test-case.operator.d.ts","sourceRoot":"","sources":["../../../src/http-testing/operators/map-to-grouped-test-case.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAGtB,KAAK,gBAAgB,EAEtB,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EAEb,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE,wBAAgB,oBAAoB,CAClC,MAAM,SAAS,qBAAqB,KACjC,gBAAgB,CACnB,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,EACvE,YAAY,CAAC,YAAY,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,MAAM,CAAC,CAC9D,CAoCA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { map, mergeMap, toArray, } from 'rxjs';
|
|
2
|
+
import {} from '../../index.js';
|
|
3
|
+
export function mapToGroupedTestCase() {
|
|
4
|
+
return mergeMap((group) => {
|
|
5
|
+
return group.pipe(toArray(), map((elements) => {
|
|
6
|
+
if (elements.length === 0) {
|
|
7
|
+
throw new Error('Empty group');
|
|
8
|
+
}
|
|
9
|
+
const envelope = {
|
|
10
|
+
ctx: elements[0].ctx,
|
|
11
|
+
current: {
|
|
12
|
+
status: 'running',
|
|
13
|
+
name: group.key,
|
|
14
|
+
start: performance.now(),
|
|
15
|
+
results: [],
|
|
16
|
+
steps: [
|
|
17
|
+
{
|
|
18
|
+
type: 'grouped',
|
|
19
|
+
transactions: [],
|
|
20
|
+
source: {
|
|
21
|
+
key: group.key,
|
|
22
|
+
transactions: elements.map((el) => el.current),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
return envelope;
|
|
29
|
+
}));
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=map-to-grouped-test-case.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-to-grouped-test-case.operator.js","sourceRoot":"","sources":["../../../src/http-testing/operators/map-to-grouped-test-case.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,GAAG,EACH,QAAQ,EAER,OAAO,GACR,MAAM,MAAM,CAAC;AAEd,OAAO,EAA+B,MAAM,gBAAgB,CAAC;AAS7D,MAAM,UAAU,oBAAoB;IAMlC,OAAO,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,IAAI,CACf,OAAO,EAAE,EACT,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;YACf,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;YACjC,CAAC;YAED,MAAM,QAAQ,GAGV;gBACF,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAE,CAAC,GAAG;gBACrB,OAAO,EAAE;oBACP,MAAM,EAAE,SAAkB;oBAC1B,IAAI,EAAE,KAAK,CAAC,GAAG;oBACf,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE;oBACxB,OAAO,EAAE,EAAE;oBACX,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,SAAS;4BACf,YAAY,EAAE,EAAmC;4BACjD,MAAM,EAAE;gCACN,GAAG,EAAE,KAAK,CAAC,GAAG;gCACd,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC;6BAC/C;yBACF;qBACF;iBACF;aACF,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|