Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(PTK-3): Adding support for pm.response.headers.all() #4

Merged
merged 1 commit into from Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/aegrey/postman-to-k6/compare/v1.8.7...HEAD)

## [1.9.1] - 2024-03-27

### Added

- Support for pm.response.headers.all() [#3](https://github.com/aegrey/postman-to-k6/issues/3)

## [1.9.0] - 2024-03-26

### Added
Expand Down
14 changes: 8 additions & 6 deletions README.md
@@ -1,9 +1,11 @@
# POSTMAN TO k6


This project is a friendly fork of [apideck-libraries/postman-to-k6](https://github.com/apideck-libraries/postman-to-k6) from the original [grafana/postman-to-k6](https://github.com/grafana/postman-to-k6), where I will focus on **building out new features not currently supported** alongside maintenance.
Due to the lack of feature support in the original library and the apideck fork, I have decided to build this out seperately as I require these features immediately in a project I'm working on. I will focus on **building out new features not currently supported** alongside maintenance

I have decided to build this out seperately as I require these features immediately in a project I'm working on.

<sup>This project is a friendly fork of [apideck-libraries/postman-to-k6](https://github.com/apideck-libraries/postman-to-k6) from the original [grafana/postman-to-k6](https://github.com/grafana/postman-to-k6).</sup>


#### Request a New Features
Open an issue with your feature request (must me something currently supported in postman) and I'll work on the requests with the most votes in order.
Expand Down Expand Up @@ -76,22 +78,22 @@ While possible to install globally, we recommend that you, if possible, add the
test project using:

```shell
$ npm install -D @apideck/postman-to-k6
$ npm install -D @aegrey/postman-to-k6
```

or using yarn...

```shell
$ yarn add @apideck/postman-to-k6
$ yarn add @aegrey/postman-to-k6
```

Note that this will require you to run the converter with `npx @apideck/postman-to-k6 your-postman-file` or, if you are
Note that this will require you to run the converter with `npx @aegrey/postman-to-k6 your-postman-file` or, if you are
using an older versions of npm, `./node_modules/.bin/postman-to-k6 your-postman-file`.

### Global Installation

```shell
$ npm install -g @apideck/postman-to-k6
$ npm install -g @aegrey/postman-to-k6
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion aegrey-changes.md
Expand Up @@ -4,5 +4,5 @@

By adding support for the
Postman [Response Data](https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/#scripting-with-response-data)
has long been unsupported, despite it being a fairly straightforward change. v1.9.0 implements support for `pm.response.headers.get()`
has long been unsupported, despite it being a fairly straightforward change. v1.9.0 implements support for `pm.response.headers.get()` and `pm.response.headers.all()`

4 changes: 4 additions & 0 deletions lib/shim/core.js
Expand Up @@ -466,6 +466,10 @@ const pm = Object.freeze({
const header = store.response.headers.cased[name];
return header ? header : null;
},
all() {
const headers = store.response.headers.cased;
return headers ? headers : null;
},
}),
get code() {
return store.response.code;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@aegrey/postman-to-k6",
"version": "1.9.0",
"version": "1.9.1",
"description": "Convert a Postman collection to k6 JavaScript",
"keywords": [
"k6",
Expand Down